Skip to content

Commit

Permalink
fix(config): missing config not being documented and fix model_ space…
Browse files Browse the repository at this point in the history
… override
  • Loading branch information
NanoCode012 committed Feb 7, 2025
1 parent a971eb4 commit e46790e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/config.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ overrides_of_model_config:
type: # linear | dynamic
factor: # float

# optional overrides the base model loading from_pretrained
overrides_of_model_kwargs:
# use_cache: False

# optional overrides to the bnb 4bit quantization configuration
# https://huggingface.co/docs/transformers/main/main_classes/quantization#transformers.BitsAndBytesConfig
bnb_config_kwargs:
Expand Down
3 changes: 3 additions & 0 deletions src/axolotl/utils/config/models/input/v0_4_1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ class RemappedParameters(BaseModel):
overrides_of_model_config: Optional[Dict[str, Any]] = Field(
default=None, alias="model_config"
)
overrides_of_model_kwargs: Optional[Dict[str, Any]] = Field(
default=None, alias="model_kwargs"
)
type_of_model: Optional[str] = Field(default=None, alias="model_type")
revision_of_model: Optional[str] = Field(default=None, alias="model_revision")

Expand Down
4 changes: 2 additions & 2 deletions src/axolotl/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ def __init__(

# init model kwargs
self.model_kwargs: Dict[str, Any] = {}
if cfg.model_kwargs:
for key, val in cfg.model_kwargs.items():
if cfg.overrides_of_model_kwargs:
for key, val in cfg.overrides_of_model_kwargs.items():
self.model_kwargs[key] = val

# init model
Expand Down

0 comments on commit e46790e

Please sign in to comment.