Merge pull request #272 from OpenAccess-AI-Collective/model-revision

support for loading a model by git revision
This commit is contained in:
Wing Lian
2023-07-13 23:12:00 -04:00
committed by GitHub

View File

@@ -154,6 +154,8 @@ def load_model(
)
model_kwargs = {}
if cfg.model_revision:
model_kwargs["revision"] = cfg.model_revision
if cfg.adapter == "qlora" and cfg.load_in_4bit:
model_kwargs["quantization_config"] = BitsAndBytesConfig(
load_in_4bit=True,