llama-recipes
llama-recipes copied to clipboard
All functionality has been consolidated into a single file for CLI/UI/Checkpointing and Added fix for issue 702 and added code for that as well, added instructions in local_inference /README.md as well
What does this PR do?
This PR adds detailed instructions for using the code-merge-inference.py
script to generate text from images after fine-tuning the Llama 3.2 vision model. The script supports merging PEFT adapter weights from a specified path. The changes include:
- Adding a new section in the
LLM_finetuning_overview.md
file under the "Inference" heading.
- Providing a usage example for running the inference script with the necessary parameters.
Fixes # (issue)
Feature/Issue validation/testing
Please describe the tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced. Please also list any relevant details for your test configuration.
- [x] Test A: Verified that the
code-merge-inference.py
script runs successfully with the provided example command. Logs for Test A:python code-merge-inference.py \ --image_path "path/to/your/image.png" \ --prompt_text "Your prompt text here" \ --temperature 1 \ --top_p 0.5 \ --model_name "meta-llama/Llama-3.2-11B-Vision-Instruct" \ --hf_token "your_hugging_face_token" \ --finetuning_path "path/to/your/finetuned/model"
Output:
Loading checkpoint shards: 100%|██████████████████| 5/5 [00:03<00:00, 1.40it/s]
Loading adapter from 'PATH/to/save/PEFT/model'...
Adapter merged successfully with the pre-trained model.
Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] 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.
- [x] Did you make sure to update the documentation with your changes?
- [ ] Did you write any new necessary tests?
Thanks for contributing 🎉!