Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -546,6 +546,9 @@ linear_proj = mm_backbone_mlp_model.mm_projector
|
|
546 |
pretrained_llm_checkpoint = lazy_load(pretrained_llm_path)
|
547 |
# 2. Load the fine-tuned LoRA weights
|
548 |
lora_checkpoint = lazy_load(lora_path)
|
|
|
|
|
|
|
549 |
# 3. merge the two checkpoints
|
550 |
model_state_dict = {**pretrained_llm_checkpoint, **lora_checkpoint}
|
551 |
model.load_state_dict(model_state_dict, strict=True)
|
|
|
546 |
pretrained_llm_checkpoint = lazy_load(pretrained_llm_path)
|
547 |
# 2. Load the fine-tuned LoRA weights
|
548 |
lora_checkpoint = lazy_load(lora_path)
|
549 |
+
for key, value in lora_checkpoint.items():
|
550 |
+
if isinstance(value, torch.Tensor):
|
551 |
+
lora_checkpoint[key] = value.to('cpu')
|
552 |
# 3. merge the two checkpoints
|
553 |
model_state_dict = {**pretrained_llm_checkpoint, **lora_checkpoint}
|
554 |
model.load_state_dict(model_state_dict, strict=True)
|