Skip to content

Models Module

class ExModel(model_path: str = None, tokenizer: Tokenizer = None, device: str = None)

Bases: ABC

An Extended Model is a 3-part object consisting of a tokenizer (T), a universe/vocabulary (U), and a model (M). The tokenizer is used to tokenize region sets into the universe. The model is defined on the universe.

Initialize the model. If model_path is not None, load the model from huggingface.

Args: model_path: Path to the model on huggingface to load tokenizer: Tokenizer to use device: Device to use (e.g. "cpu", "cuda:0", etc)

  • model (Model)
  • universe (RegionSet)
  • tokenizer (Tokenizer)