Instructions to use xgalaxy/gemma-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xgalaxy/gemma-3 with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("xgalaxy/gemma-3", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use xgalaxy/gemma-3 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for xgalaxy/gemma-3 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for xgalaxy/gemma-3 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for xgalaxy/gemma-3 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="xgalaxy/gemma-3", max_seq_length=2048, )
π§ Fine-Tuning Gemma 3B on Healthcare Admin Tasks
This repository demonstrates how to fine-tune the instruction-tuned google/gemma-3-4b-it model on a custom dataset covering administrative tasks in the healthcare industry.
π Project Overview
We use the Unsloth framework to:
- Load and quantize the base Gemma model in 4-bit precision.
- Apply LoRA (Low-Rank Adaptation) for efficient parameter tuning.
- Train the model using Hugging Face's
trllibrary andSFTTrainer.
This setup significantly reduces memory footprint and training cost, making it suitable for training on consumer GPUs (e.g. Colab, T4, A100).
π©Ί Dataset: Healthcare Admin
- Source:
xgalaxy/healthcare_admin - Format: ShareGPT-style JSON format with structured
userandassistantroles - Coverage:
- Appointment scheduling, cancellation, and rescheduling
- Edge cases involving follow-ups, missing info, and ambiguous requests
- Multi-turn conversations to emulate real-world interactions
π οΈ Key Components
β Model Setup
google/gemma-3-4b-itloaded using Unsloth'sFastModel.from_pretrained()- 4-bit quantization enabled via
load_in_4bit=True - LoRA adapters injected for memory-efficient tuning
β Training
- Supervised fine-tuning with
SFTTrainer - Batch size simulated using
gradient_accumulation_steps - Linear learning rate scheduler with warmup
- Training capped at a fixed number of steps for fast iteration
π Trained Model
The fine-tuned model is available on Hugging Face: π xgalaxy/gemma-3
π Resources
- π Unsloth GitHub
- π Gemma on Hugging Face
- ποΈ Healthcare Admin Dataset
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("xgalaxy/gemma-3", dtype="auto")