MCPcopy Create free account
hub / github.com/InternLM/InternLM-XComposer / __call__

Method __call__

example_code/utils.py:43–47  ·  view source on GitHub ↗
(self, input_ids: torch.LongTensor, scores: torch.FloatTensor)

Source from the content-addressed store, hash-verified

41 self.stops = stops
42
43 def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor):
44 for stop in self.stops:
45 if torch.all((stop == input_ids[:, -len(stop):])).item():
46 return True
47 return False
48
49
50def get_stopping_criteria(stop_words_ids):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected