Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix save metric FileNotFoundError when finetuning #499

Merged
merged 2 commits into from
May 14, 2024

Conversation

simwiki
Copy link
Contributor

@simwiki simwiki commented May 11, 2024

What does this PR do?

This PR fixes a bug where the code attempted to save metrics during training to a file that did not exist, causing an error. The fix ensures that the code checks if the file exists before attempting to save the metrics, preventing the error from occurring.

Fixes # (issue number)

Feature/Issue validation/testing

I tested the fix by running the training script with the provided command and verified that the metrics were saved without any errors. Here are the steps I followed:

  • Test saving metrics
    • Ran the training script using the following command:
    python recipes/finetuning/finetuning.py --model_name PATH//TO/Meta-Llama-3-8B --quantization \
    --use_peft --peft_method lora \
    --lora_config.r 16 \
    --lora_config.lora_dropout 0.1 \
    --num_epochs 5  \
    --batch_size_training 1 \
    --dataset alpaca_dataset \
    --batching_strategy packing \
    --output_dir ./output/peft/llama3-8B-lora-alpaca-0511-v1 \
    --use_wandb  \
    --save_metrics
    • Verified that metrics were saved to the specified file
    • Checked for any error messages or exceptions during the process

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Thanks for contributing 馃帀!

@HamidShojanazeri
Copy link
Contributor

Thanks @simwiki for the PR!

@HamidShojanazeri HamidShojanazeri merged commit 8832423 into meta-llama:main May 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants