graph LR
StaticModel_Core["StaticModel Core"]
Model_Initializer["Model Initializer"]
Text_Embedding_Engine["Text Embedding Engine"]
Model_Persistence_Handler["Model Persistence Handler"]
Core_Utilities["Core Utilities"]
Model_Initializer -- "creates" --> StaticModel_Core
Text_Embedding_Engine -- "uses" --> StaticModel_Core
Model_Persistence_Handler -- "persists" --> StaticModel_Core
Model_Initializer -- "depends on" --> Core_Utilities
Text_Embedding_Engine -- "depends on" --> Core_Utilities
Model_Persistence_Handler -- "depends on" --> Core_Utilities
The Core Model Management subsystem primarily encompasses the model2vec.model and model2vec.utils modules. Its core responsibility revolves around the lifecycle and fundamental operations of the StaticModel, including its initialization, the transformation of text into embeddings, and its persistence mechanisms.
This is the foundational data structure representing the learned model. It encapsulates the model's state and provides the primary interface for its operations, serving as the central entity around which all other components in this subsystem revolve.
Related Classes/Methods:
Responsible for the instantiation and initial setup of StaticModel instances. This includes any necessary pre-processing or normalization steps required before the model becomes operational.
Related Classes/Methods:
Manages the transformation of raw text input into numerical embeddings using the StaticModel. Its responsibilities include handling tokenization, efficient batch processing, and managing the dimensions of the generated embeddings.
Related Classes/Methods:
model2vec.model.encode:346-407model2vec.model.encode_as_sequence:270-332model2vec.model._encode_batch:409-424model2vec.model._encode_batch_as_sequence:334-344
Oversees the saving and loading of StaticModel instances to and from various storage locations. This includes local file systems and remote repositories such as the HuggingFace Hub, ensuring model reusability and distribution.
Related Classes/Methods:
model2vec.model.push_to_hub:431-449model2vec.model.save_pretrained:99-118model2vec.model.load_local:451-474model2vec.utils.load_local_model:107-128model2vec.utils.get_tensor:57-59
Provides essential, reusable support functions that are critical for the operations of other components within this subsystem. This includes general data normalization, text tokenization, dimension retrieval, and batching mechanisms.
Related Classes/Methods: