Skip to content

resolved checkpoint load bug #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions fine-tuning/clarify_aware_fine_tuning_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def tokenize_v4(samples):
if torch.__version__ >= "2" and sys.platform != "win32":
print("compiling the model")
model = torch.compile(model)
trainer.train()
trainer.train(resume_from_checkpoint=True)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test this and verify it's working as expected?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, could you add the command you ran in PR description or in code comment ? is it something like adding --checkpoint ./code-llama-fine-tuned-v1/checkpoint-220/adapter_model.safetensors in the command?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is working correctly. Actually, nothing has to be changed in the script. So similar to how you run fine-tuning in https://github.com/jie-jw-wu/clarify-aware-coder/blob/main/fine-tuning/submit_job_02212025.sh, the same exact script will work here. It will automatically load the latest checkpoint


# Evaluate the model
results = trainer.evaluate()
Expand All @@ -354,4 +354,4 @@ def tokenize_v4(samples):
with torch.cuda.amp.autocast():
output_tokens = model.generate(**batch, max_new_tokens=50)

print('\n\n', tokenizer.decode(output_tokens[0], skip_special_tokens=True))
print('\n\n', tokenizer.decode(output_tokens[0], skip_special_tokens=True))