MCPcopy Create free account
hub / github.com/TabbyML/tabby / validate

Method validate

python/ctranslate2/specs/model_spec.py:602–610  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

600 self._vocabulary = list(tokens)
601
602 def validate(self) -> None:
603 super().validate()
604
605 expected_vocabulary_size = self.get_vocabulary_size()
606 if len(self._vocabulary) != expected_vocabulary_size:
607 raise ValueError(
608 "Vocabulary has size %d but the model expected a vocabulary of size %d"
609 % (len(self._vocabulary), expected_vocabulary_size)
610 )
611
612 def save(self, output_dir: str) -> None:
613 # Save the vocabulary.

Callers

nothing calls this directly

Calls 2

get_vocabulary_sizeMethod · 0.95
validateMethod · 0.45

Tested by

no test coverage detected