This commit is contained in:
hiyouga committed 2024-03-12 17:08:34 +08:00
1 parent 06c97083e1
commit 8d8956bad5
2 files changed
+7

No files matched your search

+3
View File
@@ -291,6 +291,9 @@ def patch_config(
if "device_map" not in init_kwargs: # quant models cannot use auto device map
init_kwargs["device_map"] = model_args.device_map or {"": get_current_device()}
if init_kwargs["device_map"] == "auto":
init_kwargs["offload_folder"] = model_args.offload_folder
def patch_model(
model: "PreTrainedModel", tokenizer: "PreTrainedTokenizer", model_args: "ModelArguments", is_trainable: bool