Skip to content

Commit a4975d2

Browse files
committed
Update notebooks (targeted edits only)
1 parent ac4a520 commit a4975d2

437 files changed

Lines changed: 36960 additions & 33615 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

nb/Advanced_Llama3_1_(3B)_GRPO_LoRA.ipynb

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"<div class=\"align-center\">\n",
99
"<a href=\"https://unsloth.ai/\"><img src=\"https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png\" width=\"115\"></a>\n",
1010
"<a href=\"https://discord.gg/unsloth\"><img src=\"https://github.com/unslothai/unsloth/raw/main/images/Discord button.png\" width=\"145\"></a>\n",
11-
"<a href=\"https://docs.unsloth.ai/\"><img src=\"https://github.com/unslothai/unsloth/blob/main/images/documentation%20green%20button.png?raw=true\" width=\"125\"></a></a> Join Discord if you need help + ⭐ <i>Star us on <a href=\"https://github.com/unslothai/unsloth\">Github</a> </i> ⭐\n",
11+
"<a href=\"https://unsloth.ai/docs/\"><img src=\"https://github.com/unslothai/unsloth/blob/main/images/documentation%20green%20button.png?raw=true\" width=\"125\"></a> Join Discord if you need help + ⭐ <i>Star us on <a href=\"https://github.com/unslothai/unsloth\">Github</a> </i> ⭐\n",
1212
"</div>\n",
1313
"\n",
14-
"To install Unsloth on your own computer, follow the installation instructions on our Github page [here](https://docs.unsloth.ai/get-started/installing-+-updating).\n",
14+
"To install Unsloth on your own computer, follow the installation instructions on our Github page [here](https://unsloth.ai/docs/get-started/installing-+-updating).\n",
1515
"\n",
1616
"You will learn how to do [data prep](#Data), how to [train](#Train), how to [run the model](#Inference), & [how to save it](#Save)\n"
1717
]
@@ -32,13 +32,13 @@
3232
},
3333
"source": [
3434
"\n",
35-
"Introducing Unsloth [Standby for RL](https://docs.unsloth.ai/basics/memory-efficient-rl): GRPO is now faster, uses 30% less memory with 2x longer context.\n",
35+
"Introducing Unsloth [Standby for RL](https://unsloth.ai/docs/basics/memory-efficient-rl): GRPO is now faster, uses 30% less memory with 2x longer context.\n",
3636
"\n",
37-
"Gpt-oss fine-tuning now supports 8× longer context with 0 accuracy loss. [Read more](https://docs.unsloth.ai/basics/long-context-gpt-oss-training)\n",
37+
"Gpt-oss fine-tuning now supports 8× longer context with 0 accuracy loss. [Read more](https://unsloth.ai/docs/basics/long-context-gpt-oss-training)\n",
3838
"\n",
39-
"Unsloth now supports Text-to-Speech (TTS) models. Read our [guide here](https://docs.unsloth.ai/basics/text-to-speech-tts-fine-tuning).\n",
39+
"Unsloth now supports Text-to-Speech (TTS) models. Read our [guide here](https://unsloth.ai/docs/basics/text-to-speech-tts-fine-tuning).\n",
4040
"\n",
41-
"Visit our docs for all our [model uploads](https://docs.unsloth.ai/get-started/all-our-models) and [notebooks](https://docs.unsloth.ai/get-started/unsloth-notebooks).\n"
41+
"Visit our docs for all our [model uploads](https://unsloth.ai/docs/get-started/all-our-models) and [notebooks](https://unsloth.ai/docs/get-started/unsloth-notebooks).\n"
4242
]
4343
},
4444
{
@@ -9703,20 +9703,20 @@
97039703
"outputs": [],
97049704
"source": [
97059705
"# Merge to 16bit\n",
9706-
"if False: model.save_pretrained_merged(\"model\", tokenizer, save_method = \"merged_16bit\",)\n",
9707-
"if False: model.push_to_hub_merged(\"hf/model\", tokenizer, save_method = \"merged_16bit\", token = \"\")\n",
9706+
"if False: model.save_pretrained_merged(\"advanced_llama_finetune_16bit\", tokenizer, save_method = \"merged_16bit\",)\n",
9707+
"if False: model.push_to_hub_merged(\"HF_USERNAME/advanced_llama_finetune_16bit\", tokenizer, save_method = \"merged_16bit\", token = \"YOUR_HF_TOKEN\")\n",
97089708
"\n",
97099709
"# Merge to 4bit\n",
9710-
"if False: model.save_pretrained_merged(\"model\", tokenizer, save_method = \"merged_4bit\",)\n",
9711-
"if False: model.push_to_hub_merged(\"hf/model\", tokenizer, save_method = \"merged_4bit\", token = \"\")\n",
9710+
"if False: model.save_pretrained_merged(\"advanced_llama_finetune_4bit\", tokenizer, save_method = \"merged_4bit\",)\n",
9711+
"if False: model.push_to_hub_merged(\"HF_USERNAME/advanced_llama_finetune_4bit\", tokenizer, save_method = \"merged_4bit\", token = \"YOUR_HF_TOKEN\")\n",
97129712
"\n",
97139713
"# Just LoRA adapters\n",
97149714
"if False:\n",
9715-
" model.save_pretrained(\"model\")\n",
9716-
" tokenizer.save_pretrained(\"model\")\n",
9715+
" model.save_pretrained(\"advanced_llama_lora\")\n",
9716+
" tokenizer.save_pretrained(\"advanced_llama_lora\")\n",
97179717
"if False:\n",
9718-
" model.push_to_hub(\"hf/model\", token = \"\")\n",
9719-
" tokenizer.push_to_hub(\"hf/model\", token = \"\")\n"
9718+
" model.push_to_hub(\"HF_USERNAME/advanced_llama_lora\", token = \"YOUR_HF_TOKEN\")\n",
9719+
" tokenizer.push_to_hub(\"HF_USERNAME/advanced_llama_lora\", token = \"YOUR_HF_TOKEN\")\n"
97209720
]
97219721
},
97229722
{
@@ -9728,7 +9728,7 @@
97289728
"### GGUF / llama.cpp Conversion\n",
97299729
"To save to `GGUF` / `llama.cpp`, we support it natively now! We clone `llama.cpp` and we default save it to `q8_0`. We allow all methods like `q4_k_m`. Use `save_pretrained_gguf` for local saving and `push_to_hub_gguf` for uploading to HF.\n",
97309730
"\n",
9731-
"Some supported quant methods (full list on our [Wiki page](https://github.com/unslothai/unsloth/wiki#gguf-quantization-options)):\n",
9731+
"Some supported quant methods (full list on our [docs page](https://github.com/unslothai/unsloth/wiki#gguf-quantization-options)):\n",
97329732
"* `q8_0` - Fast conversion. High resource use, but generally acceptable.\n",
97339733
"* `q4_k_m` - Recommended. Uses Q6_K for half of the attention.wv and feed_forward.w2 tensors, else Q4_K.\n",
97349734
"* `q5_k_m` - Recommended. Uses Q6_K for half of the attention.wv and feed_forward.w2 tensors, else Q5_K.\n",
@@ -9745,26 +9745,26 @@
97459745
"outputs": [],
97469746
"source": [
97479747
"# Save to 8bit Q8_0\n",
9748-
"if False: model.save_pretrained_gguf(\"model\", tokenizer,)\n",
9748+
"if False: model.save_pretrained_gguf(\"advanced_llama_finetune\", tokenizer,)\n",
97499749
"# Remember to go to https://huggingface.co/settings/tokens for a token!\n",
97509750
"# And change hf to your username!\n",
9751-
"if False: model.push_to_hub_gguf(\"hf/model\", tokenizer, token = \"\")\n",
9751+
"if False: model.push_to_hub_gguf(\"HF_USERNAME/advanced_llama_finetune\", tokenizer, token = \"YOUR_HF_TOKEN\")\n",
97529752
"\n",
97539753
"# Save to 16bit GGUF\n",
9754-
"if False: model.save_pretrained_gguf(\"model\", tokenizer, quantization_method = \"f16\")\n",
9755-
"if False: model.push_to_hub_gguf(\"hf/model\", tokenizer, quantization_method = \"f16\", token = \"\")\n",
9754+
"if False: model.save_pretrained_gguf(\"advanced_llama_finetune\", tokenizer, quantization_method = \"f16\")\n",
9755+
"if False: model.push_to_hub_gguf(\"HF_USERNAME/advanced_llama_finetune\", tokenizer, quantization_method = \"f16\", token = \"YOUR_HF_TOKEN\")\n",
97569756
"\n",
97579757
"# Save to q4_k_m GGUF\n",
9758-
"if False: model.save_pretrained_gguf(\"model\", tokenizer, quantization_method = \"q4_k_m\")\n",
9759-
"if False: model.push_to_hub_gguf(\"hf/model\", tokenizer, quantization_method = \"q4_k_m\", token = \"\")\n",
9758+
"if False: model.save_pretrained_gguf(\"advanced_llama_finetune\", tokenizer, quantization_method = \"q4_k_m\")\n",
9759+
"if False: model.push_to_hub_gguf(\"HF_USERNAME/advanced_llama_finetune\", tokenizer, quantization_method = \"q4_k_m\", token = \"YOUR_HF_TOKEN\")\n",
97609760
"\n",
97619761
"# Save to multiple GGUF options - much faster if you want multiple!\n",
97629762
"if False:\n",
97639763
" model.push_to_hub_gguf(\n",
9764-
" \"hf/model\", # Change hf to your username!\n",
9764+
" \"HF_USERNAME/advanced_llama_finetune\", # Change hf to your username!\n",
97659765
" tokenizer,\n",
97669766
" quantization_method = [\"q4_k_m\", \"q8_0\", \"q5_k_m\",],\n",
9767-
" token = \"\",\n",
9767+
" token = \"YOUR_HF_TOKEN\",\n",
97689768
" )"
97699769
]
97709770
},
@@ -9774,20 +9774,20 @@
97749774
"id": "V15Yhj1V9lwG"
97759775
},
97769776
"source": [
9777-
"Now, use the `model-unsloth.gguf` file or `model-unsloth-Q4_K_M.gguf` file in llama.cpp.\n",
9777+
"Now, use the `advanced_llama_finetune.Q8_0.gguf` file or `advanced_llama_finetune.Q4_K_M.gguf` file in llama.cpp.\n",
97789778
"\n",
97799779
"And we're done! If you have any questions on Unsloth, we have a [Discord](https://discord.gg/unsloth) channel! If you find any bugs or want to keep updated with the latest LLM stuff, or need help, join projects etc, feel free to join our Discord!\n",
97809780
"\n",
97819781
"Some other links:\n",
97829782
"1. Train your own reasoning model - Llama GRPO notebook [Free Colab](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Llama3.1_(8B)-GRPO.ipynb)\n",
97839783
"2. Saving finetunes to Ollama. [Free notebook](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Llama3_(8B)-Ollama.ipynb)\n",
97849784
"3. Llama 3.2 Vision finetuning - Radiography use case. [Free Colab](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Llama3.2_(11B)-Vision.ipynb)\n",
9785-
"6. See notebooks for DPO, ORPO, Continued pretraining, conversational finetuning and more on our [documentation](https://docs.unsloth.ai/get-started/unsloth-notebooks)!\n",
9785+
"6. See notebooks for DPO, ORPO, Continued pretraining, conversational finetuning and more on our [documentation](https://unsloth.ai/docs/get-started/unsloth-notebooks)!\n",
97869786
"\n",
97879787
"<div class=\"align-center\">\n",
97889788
" <a href=\"https://unsloth.ai\"><img src=\"https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png\" width=\"115\"></a>\n",
97899789
" <a href=\"https://discord.gg/unsloth\"><img src=\"https://github.com/unslothai/unsloth/raw/main/images/Discord.png\" width=\"145\"></a>\n",
9790-
" <a href=\"https://docs.unsloth.ai/\"><img src=\"https://github.com/unslothai/unsloth/blob/main/images/documentation%20green%20button.png?raw=true\" width=\"125\"></a>\n",
9790+
" <a href=\"https://unsloth.ai/docs/\"><img src=\"https://github.com/unslothai/unsloth/blob/main/images/documentation%20green%20button.png?raw=true\" width=\"125\"></a>\n",
97919791
"\n",
97929792
" Join Discord if you need help + ⭐️ <i>Star us on <a href=\"https://github.com/unslothai/unsloth\">Github</a> </i> ⭐️\n",
97939793
"\n",

0 commit comments

Comments
 (0)