winglian commited on
Commit
69a2350
1 Parent(s): 687d889

support for loading a model by git revision

Browse files
Files changed (1) hide show
  1. src/axolotl/utils/models.py +2 -0
src/axolotl/utils/models.py CHANGED
@@ -154,6 +154,8 @@ def load_model(
154
  )
155
 
156
  model_kwargs = {}
 
 
157
  if cfg.adapter == "qlora" and cfg.load_in_4bit:
158
  model_kwargs["quantization_config"] = BitsAndBytesConfig(
159
  load_in_4bit=True,
 
154
  )
155
 
156
  model_kwargs = {}
157
+ if cfg.model_revision:
158
+ model_kwargs["revision"] = cfg.model_revision
159
  if cfg.adapter == "qlora" and cfg.load_in_4bit:
160
  model_kwargs["quantization_config"] = BitsAndBytesConfig(
161
  load_in_4bit=True,