Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions generate_lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def main(
t0 = time.time()

with (lazy_load(pretrained_path) as pretrained_checkpoint,
lazy_load(lora_path) as adapter_checkpoint):
lazy_load(lora_path) as lora_checkpoint):
name = llama_model_lookup(pretrained_checkpoint)

with EmptyInitOnDevice(
Expand All @@ -85,8 +85,8 @@ def main(

# 1. Load the pretrained weights
model.load_state_dict(pretrained_checkpoint, strict=False)
# 2. Load the fine-tuned adapter weights
model.load_state_dict(adapter_checkpoint, strict=False)
# 2. Load the fine-tuned lora weights
model.load_state_dict(lora_checkpoint, strict=False)

print(f"Time to load model: {time.time() - t0:.02f} seconds.", file=sys.stderr)

Expand Down