diff --git a/nb/Kaggle-Gemma3_(4B).ipynb b/nb/Kaggle-Gemma3_(4B).ipynb index ac2f981..6d50965 100644 --- a/nb/Kaggle-Gemma3_(4B).ipynb +++ b/nb/Kaggle-Gemma3_(4B).ipynb @@ -8,7 +8,7 @@ "
\n", "\n", "\n", - " Join Discord if you need help + \u2b50 Star us on Github \u2b50\n", + " Join Discord if you need help + ⭐ Star us on Github ⭐\n", "
\n", "\n", "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", @@ -44,7 +44,14 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": "%%capture\n!pip install unsloth vllm\n!pip install triton==3.1.0\n!pip install -U pynvml\n# Install latest Hugging Face for Gemma-3!\n!pip install --no-deps git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3" + "source": [ + "%%capture\n", + "!pip install unsloth vllm\n", + "!pip install triton==3.1.0\n", + "!pip install -U pynvml\n", + "# Install latest Hugging Face for Gemma-3!\n", + "!pip install --no-deps git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3" + ] }, { "cell_type": "markdown", @@ -185,8 +192,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.3.14: Fast Gemma3 patching. Transformers: 4.50.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", @@ -680,7 +687,7 @@ ], "source": [ "def apply_chat_template(examples):\n", - " texts = tokenizer.apply_chat_template(examples[\"conversations\"])\n", + " texts = tokenizer.apply_chat_template(examples[\"conversations\"], tokenize = False)\n", " return { \"text\" : texts }\n", "pass\n", "dataset = dataset.map(apply_chat_template, batched = True)" @@ -1245,6 +1252,7 @@ "from unsloth.chat_templates import get_chat_template\n", "tokenizer = get_chat_template(\n", " tokenizer,\n", + " tokenize = False,\n", " chat_template = \"gemma-3\",\n", ")\n", "messages = [{\n", @@ -1306,6 +1314,7 @@ "}]\n", "text = tokenizer.apply_chat_template(\n", " messages,\n", + " tokenize = False,\n", " add_generation_prompt = True, # Must add for generation\n", ")\n", "\n", @@ -1408,6 +1417,7 @@ "}]\n", "text = tokenizer.apply_chat_template(\n", " messages,\n", + " tokenize = False,\n", " add_generation_prompt = True, # Must add for generation\n", ")\n", "\n", @@ -1538,7 +1548,7 @@ " \n", " \n", "\n", - " Join Discord if you need help + \u2b50\ufe0f Star us on Github \u2b50\ufe0f\n", + " Join Discord if you need help + ⭐️ Star us on Github ⭐️\n", "\n" ] } @@ -1703,9 +1713,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_3530e2b431c041c6aeeaca4808ba0424", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_cc14e51320f34274ae12aa28b04183b7", - "value": "\u200735.0/35.0\u2007[00:00<00:00,\u20072.05kB/s]" + "value": " 35.0/35.0 [00:00<00:00, 2.05kB/s]" } }, "083eaaf245954cc998e8f20e8120eed1": { @@ -1828,9 +1838,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_708d05af00a64d19bb11dc839a5e68db", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_3d20e28d74e549c0a43686b214eebd87", - "value": "preprocessor_config.json:\u2007100%" + "value": "preprocessor_config.json: 100%" } }, "0a67ecf349484aa18e1151aa2bc1a9ae": { @@ -1849,9 +1859,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_4b1e445cfec04a0f8566be97d8388310", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_68f1f454dee4462ebf03789f2df9e0f9", - "value": "Unsloth:\u2007Standardizing\u2007formats\u2007(num_proc=2):\u2007100%" + "value": "Unsloth: Standardizing formats (num_proc=2): 100%" } }, "0abe1a2b12e54bb5a07db1a8f3a77738": { @@ -1974,9 +1984,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c4a69698321d435c94211a9dee913c45", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_36c8135711194884be0e03cb5d3ae7e5", - "value": "\u20071.61k/1.61k\u2007[00:00<00:00,\u2007181kB/s]" + "value": " 1.61k/1.61k [00:00<00:00, 181kB/s]" } }, "0cba80b626574c11a44c6ce09b5d6e80": { @@ -1995,9 +2005,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_12d3049cca4a46c08cf5cdfcd5225248", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_6a9baf0a739c4790baf99b0ccadd6873", - "value": "\u200733.4M/33.4M\u2007[00:00<00:00,\u200770.2MB/s]" + "value": " 33.4M/33.4M [00:00<00:00, 70.2MB/s]" } }, "0db66084c58047aa84edf3b4fbede0c0": { @@ -2090,9 +2100,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_54d2fb7e7c2b4107ba758a7c7ef4f382", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_34da5010faa749e0940c2821f2f46e59", - "value": "\u2007100000/100000\u2007[00:43<00:00,\u20072627.58\u2007examples/s]" + "value": " 100000/100000 [00:43<00:00, 2627.58 examples/s]" } }, "173033e49f9f46d9930c6afddc983509": { @@ -2111,9 +2121,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_441ff92725ef40ce807daa1ff721faef", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_21136eec72034fcbb47a19f92aa0664d", - "value": "\u2007982/982\u2007[00:00<00:00,\u200778.7kB/s]" + "value": " 982/982 [00:00<00:00, 78.7kB/s]" } }, "17eaf723882e4efea38119978166fc75": { @@ -2132,9 +2142,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_cebd4fbf1fcf4ab2b65ecf539eda5a1e", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_f14ea72beac74152af5f970e634769ca", - "value": "generation_config.json:\u2007100%" + "value": "generation_config.json: 100%" } }, "18fce8679d7d4961b88bb2162e7aa9eb": { @@ -2153,9 +2163,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_f9439c3c9b3b4c4a84ed67aa0601a530", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_a89575b4c58348ac98566c22ab7e4118", - "value": "chat_template.json:\u2007100%" + "value": "chat_template.json: 100%" } }, "19c27988e01d47e79319f89b5cfd73e2": { @@ -2393,9 +2403,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c5b1d1476ddc45249e037df07a96ae37", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_19c27988e01d47e79319f89b5cfd73e2", - "value": "Unsloth:\u2007Tokenizing\u2007["text"]\u2007(num_proc=2):\u2007100%" + "value": "Unsloth: Tokenizing ["text"] (num_proc=2): 100%" } }, "21136eec72034fcbb47a19f92aa0664d": { @@ -2429,9 +2439,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_9e20d704e64a4aaabe5e495c468d9670", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_ae4e4537ed1d4df4b1677700d190a2d2", - "value": "\u2007192/192\u2007[00:00<00:00,\u200720.1kB/s]" + "value": " 192/192 [00:00<00:00, 20.1kB/s]" } }, "28063728d31f45aea5beffd3f114eec7": { @@ -2791,9 +2801,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_9511c493311b4d4e94d5dc0aca4eeffb", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_f4265abad437426b8efa9091110c77c9", - "value": "train-00000-of-00001.parquet:\u2007100%" + "value": "train-00000-of-00001.parquet: 100%" } }, "34da5010faa749e0940c2821f2f46e59": { @@ -2983,9 +2993,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_70fdd31291b04dd68d66cf31c03d23ff", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_6feaf338d39440e78221649ac84af4a6", - "value": "special_tokens_map.json:\u2007100%" + "value": "special_tokens_map.json: 100%" } }, "36c8135711194884be0e03cb5d3ae7e5": { @@ -3097,9 +3107,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_7e5378838c114195ba3919fdd683fd7d", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_3350d22f463643ef9a726227f262ac49", - "value": "\u2007100000/100000\u2007[03:03<00:00,\u2007568.03\u2007examples/s]" + "value": " 100000/100000 [03:03<00:00, 568.03 examples/s]" } }, "409488926d2242c5a8e7b3d5b79c59db": { @@ -3405,9 +3415,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_5e9ba3247edc4fafa7687338424ddccb", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_97d7e3420e24436cb351b1e9679ff8b6", - "value": "\u2007670/670\u2007[00:00<00:00,\u200742.7kB/s]" + "value": " 670/670 [00:00<00:00, 42.7kB/s]" } }, "4e7cbb77617f43e6ae81e42eb7086fb7": { @@ -3620,9 +3630,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_52f091f99f0442f8bd14a50b7c870c1e", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_c859133fca324effb73ebc3520e746b6", - "value": "\u2007570/570\u2007[00:00<00:00,\u200761.1kB/s]" + "value": " 570/570 [00:00<00:00, 61.1kB/s]" } }, "55164fb3b49848beabfe0da534ab4b97": { @@ -3777,9 +3787,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_a15e4524521b42108f49dda23ed56023", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_a4eaae1b30d442208257c1870d549738", - "value": "processor_config.json:\u2007100%" + "value": "processor_config.json: 100%" } }, "5c01ab4767104c0c96c42858317f8877": { @@ -4404,9 +4414,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_73a283e64f324c27b38216e683050b92", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_81bddfaa180d4875b5cdb5cc4ae45dab", - "value": "added_tokens.json:\u2007100%" + "value": "added_tokens.json: 100%" } }, "77e843913b6e439ead9cf42725eedf3d": { @@ -4492,9 +4502,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_006e1f7432f84b298f61bb597b8aab10", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_f496e27e3d6446c7997c6fc549de69fa", - "value": "README.md:\u2007100%" + "value": "README.md: 100%" } }, "7e5378838c114195ba3919fdd683fd7d": { @@ -4632,9 +4642,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_e12bca7d49b149b5b1124c28a669db98", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_fab7a02d350946ae9563a05cfd04e22b", - "value": "model.safetensors:\u2007100%" + "value": "model.safetensors: 100%" } }, "84c68f2059f247628b672b1079130e9b": { @@ -4831,9 +4841,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_94d9900bc8934de688e95e15c9d0c9bb", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_b469cdf580404f498feb062e4dbad10b", - "value": "\u20074.69M/4.69M\u2007[00:00<00:00,\u200722.1MB/s]" + "value": " 4.69M/4.69M [00:00<00:00, 22.1MB/s]" } }, "899bf9a4dc594e178d0b95e3cbe08018": { @@ -4988,9 +4998,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_ebecfe57cabc46028198957fb45114cc", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_ba9001d2d8db4f75abb557fc2306bf5b", - "value": "\u2007100000/100000\u2007[00:17<00:00,\u20076582.77\u2007examples/s]" + "value": " 100000/100000 [00:17<00:00, 6582.77 examples/s]" } }, "94d9900bc8934de688e95e15c9d0c9bb": { @@ -5304,9 +5314,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_1ecb60e1d5934ea19a0d2c29aa01158d", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_f920f6cb263c45d59b851b7c6b631cb5", - "value": "\u200770.0/70.0\u2007[00:00<00:00,\u20078.21kB/s]" + "value": " 70.0/70.0 [00:00<00:00, 8.21kB/s]" } }, "a0cf0f8dd74a4d5181d465fa7ff52915": { @@ -5503,9 +5513,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_7ff7c3b516d84706a47e91c64b50d171", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_7850eeab711f494399e82bf96f942888", - "value": "\u2007117M/117M\u2007[00:00<00:00,\u2007213MB/s]" + "value": " 117M/117M [00:00<00:00, 213MB/s]" } }, "a4a64136f6fc48c799abf1701725534e": { @@ -5835,9 +5845,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_2fa2784330b2439ab884ce0966037961", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_51649c42cf2145f1b1e90c3436805350", - "value": "\u20074.44G/4.44G\u2007[00:31<00:00,\u2007142MB/s]" + "value": " 4.44G/4.44G [00:31<00:00, 142MB/s]" } }, "b469cdf580404f498feb062e4dbad10b": { @@ -5923,9 +5933,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_0881c055108340f7ab4b840ac1545cbb", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_77907c3444174858bbdc548dee8d0d37", - "value": "tokenizer.json:\u2007100%" + "value": "tokenizer.json: 100%" } }, "ba9001d2d8db4f75abb557fc2306bf5b": { @@ -6170,9 +6180,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_353fa47fb98c4070a150edec64503eaa", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_40bf6f1ffbc5479082fdd7ab153ea974", - "value": "tokenizer_config.json:\u2007100%" + "value": "tokenizer_config.json: 100%" } }, "c43cef665c9542f982986a74dc50ca98": { @@ -6611,9 +6621,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_457c60d6a15d4314ba25d370be956a60", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_bc6f29c9a1e14ce8be374867b8be86ac", - "value": "\u20071.16M/1.16M\u2007[00:00<00:00,\u200710.7MB/s]" + "value": " 1.16M/1.16M [00:00<00:00, 10.7MB/s]" } }, "dd6e4f9b4c6d4260a62b920a6812fd07": { @@ -6632,9 +6642,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_879c6a0498e54e5c87145c7f7d32de7e", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_740d351b7de241a6acabf6c2853585b6", - "value": "tokenizer.model:\u2007100%" + "value": "tokenizer.model: 100%" } }, "ded71beadafd438ebff07bb0594771e4": { @@ -6795,9 +6805,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_ce2ae7abaa4841478a732238269aa233", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_5fd55097dac149579c533b2798ebb442", - "value": "\u2007100000/100000\u2007[00:02<00:00,\u200760707.08\u2007examples/s]" + "value": " 100000/100000 [00:02<00:00, 60707.08 examples/s]" } }, "e12bca7d49b149b5b1124c28a669db98": { @@ -6892,9 +6902,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_490baae8c2294c2194f32dae183ce833", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_3a24c19f9a6a4e4dba162062a0562db2", - "value": "\u2007100000/100000\u2007[00:07<00:00,\u200713546.66\u2007examples/s]" + "value": " 100000/100000 [00:07<00:00, 13546.66 examples/s]" } }, "ea9045a5c4504a5e96e6a7b13767fe4e": { @@ -7011,9 +7021,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_28063728d31f45aea5beffd3f114eec7", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_d86e65b9ea5f47c58b3f2274e4989f93", - "value": "Generating\u2007train\u2007split:\u2007100%" + "value": "Generating train split: 100%" } }, "efa41d07d0fa4adda8025fe9490ed850": { @@ -7167,9 +7177,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_28de62814a6847e0a0b41ec6bf8fdc66", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_c43cef665c9542f982986a74dc50ca98", - "value": "Map\u2007(num_proc=2):\u2007100%" + "value": "Map (num_proc=2): 100%" } }, "f89c08592a25432497bb312f58a13c5c": { @@ -7277,9 +7287,9 @@ "description": "", "description_tooltip": null, "layout": "IPY_MODEL_a0cf0f8dd74a4d5181d465fa7ff52915", - "placeholder": "\u200b", + "placeholder": "​", "style": "IPY_MODEL_529996f48ccf404584725386d33401f9", - "value": "Map:\u2007100%" + "value": "Map: 100%" } }, "fab7a02d350946ae9563a05cfd04e22b": { @@ -7378,4 +7388,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +}