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

Method __init__

generation_utils.py:454–457  ·  view source on GitHub ↗
(self, ngram_size: int)

Source from the content-addressed store, hash-verified

452 """
453
454 def __init__(self, ngram_size: int):
455 if not isinstance(ngram_size, int) or ngram_size <= 0:
456 raise ValueError(f"`ngram_size` has to be a strictly positive integer, but is {ngram_size}")
457 self.ngram_size = ngram_size
458
459 def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor:
460 num_batch_hypotheses = scores.shape[0]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected