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

Method __call__

utils.py:10–15  ·  view source on GitHub ↗
(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs)

Source from the content-addressed store, hash-verified

8 self.stop_indices = stop_indices
9
10 def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool:
11 # do not support batch inference
12 for i in range(len(self.stop_indices)):
13 if self.stop_indices[-1-i] != input_ids[0][-1-i]:
14 return False
15 return True

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected