MCPcopy Create free account
hub / github.com/THUDM/GLM / __call__

Method __call__

generation_utils.py:437–441  ·  view source on GitHub ↗
(self, input_ids: torch.LongTensor, scores: torch.FloatTensor)

Source from the content-addressed store, hash-verified

435 self.eos_token_id = eos_token_id
436
437 def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor:
438 cur_len = input_ids.shape[-1]
439 if cur_len < self.min_length:
440 scores[:, self.eos_token_id] = -float("inf")
441 return scores
442
443
444class NoRepeatNGramLogitsProcessor(LogitsProcessor):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected