fix: load QLoRA model to CPU first, DeepSpeed distributes
This commit is contained in:
@@ -47,7 +47,7 @@ def train(config_path):
|
|||||||
config["base_model"],
|
config["base_model"],
|
||||||
quantization_config=bnb_config,
|
quantization_config=bnb_config,
|
||||||
dtype=torch.bfloat16,
|
dtype=torch.bfloat16,
|
||||||
device_map="auto",
|
device_map="cpu", # Load to CPU first
|
||||||
trust_remote_code=True,
|
trust_remote_code=True,
|
||||||
)
|
)
|
||||||
print("Model loaded with QLoRA (4-bit).")
|
print("Model loaded with QLoRA (4-bit).")
|
||||||
|
|||||||
Reference in New Issue
Block a user