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

Method save

python/ctranslate2/specs/model_spec.py:538–549  ·  view source on GitHub ↗
(self, output_dir: str)

Source from the content-addressed store, hash-verified

536 )
537
538 def save(self, output_dir: str) -> None:
539 # Save the vocabularies.
540 vocabularies = dict(_flatten_vocabularies(self._vocabularies))
541 all_vocabularies = list(vocabularies.values())
542 if all(vocabulary == all_vocabularies[0] for vocabulary in all_vocabularies):
543 vocabularies = {"shared": all_vocabularies[0]}
544
545 for name, tokens in vocabularies.items():
546 _save_vocabulary(output_dir, "%s_vocabulary" % name, tokens)
547
548 # Save the rest of the model.
549 super().save(output_dir)
550
551
552class LanguageModelConfig(ModelConfig):

Callers

nothing calls this directly

Calls 3

_flatten_vocabulariesFunction · 0.85
_save_vocabularyFunction · 0.85
saveMethod · 0.45

Tested by

no test coverage detected