- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.3k
Update SFT QLoRA notebook with **14B** model on free Colab #4336
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
Conversation
| The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. | 
| } | ||
| ], | ||
| "source": [ | ||
| "prompt = hf_tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)\n", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use llm.chat directly here
| "import torch\n", | ||
| "\n", | ||
| "llm = LLM(\n", | ||
| " model=f\"sergiopaniego/{output_dir}-merged\", # Replace with your HF username or organization\n", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to do it right now but in the future it could be nice to centralize every artifact in hf.co/trl-lib
| " **model_inputs,\n", | ||
| " max_new_tokens=512\n", | ||
| ")\n", | ||
| "output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()\n", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: tolist no needed
| "output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()\n", | |
| "output_ids = generated_ids[0][len(model_inputs.input_ids[0]):]\n", | 
…sft_qlora_notebook
…sft_qlora_notebook
…_lora_qlora.ipynb`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super cool notebook, merging now, sorry for late review


What does this PR do?
Fine tune a 14B model on free Colab using TRL+SFT!
It already uses this PR so its dependent on it
Before submitting
Pull Request section?
to it if that's the case.
Who can review?
@qgallouedec @kashif