MCPcopy Create free account
hub / github.com/FreedomIntelligence/CMB / __call__

Method __call__

workers/chatglm3_modeling.py:54–58  ·  view source on GitHub ↗
(self, input_ids: torch.LongTensor, scores: torch.FloatTensor)

Source from the content-addressed store, hash-verified

52
53class InvalidScoreLogitsProcessor(LogitsProcessor):
54 def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor:
55 if torch.isnan(scores).any() or torch.isinf(scores).any():
56 scores.zero_()
57 scores[..., 5] = 5e4
58 return scores
59
60
61class PrefixEncoder(torch.nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected