{"id":30713183,"url":"https://github.com/jpisnice/finetunegemma3n","last_synced_at":"2026-07-18T20:35:09.604Z","repository":{"id":310453992,"uuid":"1039901715","full_name":"Jpisnice/FinetuneGemma3n","owner":"Jpisnice","description":"Finetuining Gemma3n with FineTome-100k dataset","archived":false,"fork":false,"pushed_at":"2025-08-19T13:10:49.000Z","size":464,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-22T08:21:33.646Z","etag":null,"topics":["ai","fine","gemma","google","ju","ml"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jpisnice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-18T06:47:29.000Z","updated_at":"2025-08-25T13:47:41.000Z","dependencies_parsed_at":"2025-08-18T08:38:41.913Z","dependency_job_id":"36891bbb-7c9e-4b0e-93b2-7c81ec4ee731","html_url":"https://github.com/Jpisnice/FinetuneGemma3n","commit_stats":null,"previous_names":["jpisnice/finetunegemma3n"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jpisnice/FinetuneGemma3n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jpisnice%2FFinetuneGemma3n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jpisnice%2FFinetuneGemma3n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jpisnice%2FFinetuneGemma3n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jpisnice%2FFinetuneGemma3n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jpisnice","download_url":"https://codeload.github.com/Jpisnice/FinetuneGemma3n/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jpisnice%2FFinetuneGemma3n/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35630866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-18T02:00:07.223Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","fine","gemma","google","ju","ml"],"created_at":"2025-09-03T03:42:47.292Z","updated_at":"2026-07-18T20:35:09.581Z","avatar_url":"https://github.com/Jpisnice.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FinetuneGemma3n\n\nA small cookbook for fine-tuning Gemma-3N models using the Unsloth FastModel wrapper and TRL (SFTTrainer).\n\nThis repository contains a runnable Colab/VS Code notebook that demonstrates how to:\n- load a Gemma-3N base model (4-bit quantized),\n- prepare conversational datasets for instruction/response fine-tuning,\n- apply LoRA-style PEFT adapters,\n- train using TRL's SFTTrainer configured to train only on assistant responses,\n- save the resulting adapters and export to formats such as merged fp16 or GGUF for deployment.\n\nQuick links\n- Notebook: `finetuneGemma3n.ipynb` (Colab badge available inside the notebook)\n\nRequirements\n- Python 3.8+ (recommended 3.10+)\n- GPU with CUDA for training (optional for small tests)\n- The notebook installs the required libraries when run in Colab. Locally, install the packages below:\n\n```\npip install -r requirements.txt\n```\n\n(If there is no `requirements.txt`, the notebook installs the necessary packages automatically.)\n\nGetting started (Colab)\n1. Open `finetuneGemma3n.ipynb` in Colab using the badge at the top of the notebook.\n2. Run the installation cells to install dependencies.\n3. Edit the model/dataset cells as needed (e.g., change model name or dataset split).\n4. Run the training cells.\n\nKey notebook sections\n- Installation: installs Unsloth and supporting libraries (bitsandbytes, accelerate, trl, peft, etc.)\n- Load the Model: demonstrates FastModel.from_pretrained and 4-bit loading\n- Dataset Preparation: loads a dataset, standardizes chat format and masks instruction tokens\n- Training: configures TRL's SFTTrainer and trains only on assistant responses\n- Saving: shows how to save LoRA adapters, merged fp16 model, and export GGUF\n\nSaving and Export\n- `model.save_pretrained(\"gemma-3n\")` and `tokenizer.save_pretrained(\"gemma-3n\")` saves LoRA adapters locally.\n- The notebook contains examples to merge and save to fp16 for VLLM or export to GGUF for llama.cpp.\n\nTroubleshooting\n- Notebook rendering on GitHub: If you run into widget metadata rendering errors (missing `metadata.widgets.state`), open the notebook locally and remove `metadata.widgets` or run a small nbformat script to clean metadata. The repository's notebook has been cleaned for GitHub rendering.\n- Out-of-memory: reduce batch size, use gradient accumulation, or use 4-bit loading as shown.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpisnice%2Ffinetunegemma3n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpisnice%2Ffinetunegemma3n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpisnice%2Ffinetunegemma3n/lists"}