MCPcopy Create free account
hub / github.com/OpenMOSS/MOSS / __init__

Method __init__

finetune_moss.py:128–133  ·  view source on GitHub ↗
(self, device)

Source from the content-addressed store, hash-verified

126
127class SFTMetric:
128 def __init__(self, device):
129 self.n_step = 0
130 self.right = torch.Tensor([0]).to(device=device)
131 self.total = torch.Tensor([0]).to(device=device)
132 self.total_loss = torch.Tensor([0]).to(device=device)
133 self.world_size = dist.get_world_size()
134
135 def __call__(self, logits, labels, loss):
136 return self.update(logits, labels, loss)

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected