rxn.onmt_utils.model_introspection.model_vocab_is_compatible

rxn.onmt_utils.model_introspection.model_vocab_is_compatible(model_pt, vocab_pt)[source]

Determine whether the vocabulary contained in a model checkpoint contains all the necessary tokens from a vocab file.

Parameters
  • model_pt (Union[str, PathLike]) – model checkpoint, such as model_step_100000.pt.

  • vocab_pt (Union[str, PathLike]) – vocab file, such as preprocessed.vocab.pt.

Return type

bool