ModelConfig¶
The ModelConfig class wraps model and tokenizer loading.
ModelConfig ¶
Model and Tokenizer
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_id
|
str
|
Model ID (Hugging Face Hub ID). |
None
|
path
|
str
|
Path to the saved model and tokenizer. |
None
|
dtype
|
str
|
Data type. Defaults to "float16". |
'float16'
|
device
|
str
|
Device to use ("cpu", "cuda", "auto"). Defaults to "auto". |
'auto'
|
Example
model_config = ModelConfig(model_id="TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T") model = model_config.load_model() tokenizer = model_config.load_tokenizer()
load_model ¶
Load the model
Automatically selects the appropriate AutoModel class based on the model's architecture (CausalLM, Vision2Seq, etc.).
has_additional_data ¶
Check if the model has additional data
Returns True if there are settings other than model_id, path, dtype, device.
Currently always returns False. Should return True when additional settings are added.