Skip to content
Merged
Show file tree
Hide file tree
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
55 changes: 35 additions & 20 deletions nb/Gemma3N_(4B)-Audio.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"<div class=\"align-center\">\n",
"<a href=\"https://unsloth.ai/\"><img src=\"https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png\" width=\"115\"></a>\n",
"<a href=\"https://discord.gg/unsloth\"><img src=\"https://github.com/unslothai/unsloth/raw/main/images/Discord button.png\" width=\"145\"></a>\n",
"<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 + \u2b50 <i>Star us on <a href=\"https://github.com/unslothai/unsloth\">Github</a> </i> \u2b50\n",
"<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",
"</div>\n",
"\n",
"To install Unsloth your local device, follow [our guide](https://docs.unsloth.ai/get-started/install-and-update). This notebook is licensed [LGPL-3.0](https://github.com/unslothai/notebooks?tab=LGPL-3.0-1-ov-file#readme).\n",
Expand Down Expand Up @@ -51,7 +51,22 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": "%%capture\nimport os, re\nif \"COLAB_\" not in \"\".join(os.environ.keys()):\n !pip install unsloth\nelse:\n # Do this only in Colab notebooks! Otherwise use pip install unsloth\n import torch; v = re.match(r\"[0-9\\.]{3,}\", str(torch.__version__)).group(0)\n xformers = \"xformers==\" + (\"0.0.32.post2\" if v == \"2.8.0\" else \"0.0.29.post3\")\n !pip install --no-deps bitsandbytes accelerate {xformers} peft trl triton cut_cross_entropy unsloth_zoo\n !pip install sentencepiece protobuf \"datasets>=3.4.1,<4.0.0\" \"huggingface_hub>=0.34.0\" hf_transfer\n !pip install --no-deps unsloth\n!pip install transformers==4.56.2\n!pip install --no-deps trl==0.22.2\nimport torch; torch._dynamo.config.recompile_limit = 64;\n"
"source": [
"%%capture\n",
"import os, re\n",
"if \"COLAB_\" not in \"\".join(os.environ.keys()):\n",
" !pip install unsloth\n",
"else:\n",
" # Do this only in Colab notebooks! Otherwise use pip install unsloth\n",
" import torch; v = re.match(r\"[0-9\\.]{3,}\", str(torch.__version__)).group(0)\n",
" xformers = \"xformers==\" + (\"0.0.32.post2\" if v == \"2.8.0\" else \"0.0.29.post3\")\n",
" !pip install --no-deps bitsandbytes accelerate {xformers} peft trl triton cut_cross_entropy unsloth_zoo\n",
" !pip install sentencepiece protobuf \"datasets>=3.4.1,<4.0.0\" \"huggingface_hub>=0.34.0\" hf_transfer\n",
" !pip install --no-deps unsloth\n",
"!pip install transformers==4.56.2\n",
"!pip install --no-deps trl==0.22.2\n",
"import torch; torch._dynamo.config.recompile_limit = 64;\n"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -111,8 +126,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\ud83e\udda5 Unsloth: Will patch your computer to enable 2x faster free finetuning.\n",
"\ud83e\udda5 Unsloth Zoo will now patch everything to make training faster!\n",
"🦥 Unsloth: Will patch your computer to enable 2x faster free finetuning.\n",
"🦥 Unsloth Zoo will now patch everything to make training faster!\n",
"==((====))== Unsloth 2025.7.5: Fast Gemma3N patching. Transformers: 4.54.0.dev0.\n",
" \\\\ /| Tesla T4. Num GPUs = 1. Max memory: 14.741 GB. Platform: Linux.\n",
"O^O/ \\_/ \\ Torch: 2.6.0+cu124. CUDA: 7.5. CUDA Toolkit: 12.4. Triton: 3.2.0\n",
Expand Down Expand Up @@ -269,7 +284,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
" Ich, ich rechne direkt mich an. Das ist nat\u00fcrlich klar, nur, dass, \u00e4h, es politische Interessen gibt im Handel, im Austausch mit Waren, dass es politische Einfl\u00fcsse gibt. Die Frage ist, die Alternative soll es nicht sein.\n"
" Ich, ich rechne direkt mich an. Das ist natürlich klar, nur, dass, äh, es politische Interessen gibt im Handel, im Austausch mit Waren, dass es politische Einflüsse gibt. Die Frage ist, die Alternative soll es nicht sein.\n"
]
},
{
Expand Down Expand Up @@ -320,7 +335,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Sie direkt mich an. Das finde ich klar, nur dass es politisch Interessen gibt im Handel, im Austausch mit Waren, dass es politische Einfl\u00fcsse gibt. Die Frage ist, die Alternative soll es nicht sein.<end_of_turn>\n"
"Sie direkt mich an. Das finde ich klar, nur dass es politisch Interessen gibt im Handel, im Austausch mit Waren, dass es politische Einflüsse gibt. Die Frage ist, die Alternative soll es nicht sein.<end_of_turn>\n"
]
}
],
Expand Down Expand Up @@ -1426,7 +1441,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Du sprichst direkt mich an. Das finde ich klar, nur, dass, \u00e4h, dass politische Interessen gibt im Handel, im Austausch mit Waren, dass es politische Einfl\u00fcsse gibt. Die Frage ist, die Alternative soll es nicht sein.<end_of_turn>\n"
"Du sprichst direkt mich an. Das finde ich klar, nur, dass, äh, dass politische Interessen gibt im Handel, im Austausch mit Waren, dass es politische Einflüsse gibt. Die Frage ist, die Alternative soll es nicht sein.<end_of_turn>\n"
]
}
],
Expand Down Expand Up @@ -1641,10 +1656,9 @@
"source": [
"if False: # Change to True to upload GGUF\n",
" model.push_to_hub_gguf(\n",
" \"gemma-3N-finetune\",\n",
" \"HF_ACCOUNT/gemma-3N-finetune-gguf\",\n",
" processor,\n",
" quantization_method = \"Q8_0\", # Only Q8_0, BF16, F16 supported\n",
" repo_id = \"HF_ACCOUNT/gemma-3N-finetune-gguf\",\n",
" token = \"hf_...\",\n",
" )"
]
Expand All @@ -1670,9 +1684,10 @@
" <a href=\"https://discord.gg/unsloth\"><img src=\"https://github.com/unslothai/unsloth/raw/main/images/Discord.png\" width=\"145\"></a>\n",
" <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",
"\n",
" Join Discord if you need help + \u2b50\ufe0f <i>Star us on <a href=\"https://github.com/unslothai/unsloth\">Github</a> </i> \u2b50\ufe0f\n",
" Join Discord if you need help + ⭐️ <i>Star us on <a href=\"https://github.com/unslothai/unsloth\">Github</a> </i> ⭐️\n",
"</div>\n",
"\n This notebook and all Unsloth notebooks are licensed [LGPL-3.0](https://github.com/unslothai/notebooks?tab=LGPL-3.0-1-ov-file#readme).\n"
"\n",
" This notebook and all Unsloth notebooks are licensed [LGPL-3.0](https://github.com/unslothai/notebooks?tab=LGPL-3.0-1-ov-file#readme).\n"
]
}
],
Expand Down Expand Up @@ -1793,9 +1808,9 @@
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_dd596d7ce92847178805247ed2ea2902",
"placeholder": "\u200b",
"placeholder": "",
"style": "IPY_MODEL_56256ba8e73c48898b147d2b91f4fd85",
"value": "Loading\u2007checkpoint\u2007shards:\u2007100%"
"value": "Loading checkpoint shards: 100%"
}
},
"54cedbd8ef984f6a89590f1651804c03": {
Expand Down Expand Up @@ -1881,9 +1896,9 @@
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_9d544cff64354e6695e90cfd70743d72",
"placeholder": "\u200b",
"placeholder": "",
"style": "IPY_MODEL_3e16f926611b458fbfa21f75bd8de2c2",
"value": "Map\u2007(num_proc=4):\u2007100%"
"value": "Map(num_proc=4): 100%"
}
},
"6dbca67a4bcf491fa0cdc07f10cca9c2": {
Expand Down Expand Up @@ -2352,9 +2367,9 @@
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_2d0675287f864fbdac1ca1439bc50077",
"placeholder": "\u200b",
"placeholder": "",
"style": "IPY_MODEL_8ef02bdc9627427d83a6324cb59c445e",
"value": "\u20073/3\u2007[00:39&lt;00:00,\u200711.72s/it]"
"value": " 3/3 [00:39&lt;00:00, 11.72s/it]"
}
},
"ecbee91d79834a49ab0cb3e33522d8d2": {
Expand Down Expand Up @@ -2389,9 +2404,9 @@
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_54cedbd8ef984f6a89590f1651804c03",
"placeholder": "\u200b",
"placeholder": "",
"style": "IPY_MODEL_9fdf6d3312be4f51912561ae1cb5a893",
"value": "\u20073000/3000\u2007[09:19&lt;00:00,\u2007\u20073.22\u2007examples/s]"
"value": " 3000/3000[09:19&lt;00:00,  3.22 examples/s]"
}
},
"state": {}
Expand All @@ -2400,4 +2415,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
Loading