Instructions to use delayedkarma/gemma-4-finetune-finetome10k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use delayedkarma/gemma-4-finetune-finetome10k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="delayedkarma/gemma-4-finetune-finetome10k") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("delayedkarma/gemma-4-finetune-finetome10k") model = AutoModelForMultimodalLM.from_pretrained("delayedkarma/gemma-4-finetune-finetome10k") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use delayedkarma/gemma-4-finetune-finetome10k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "delayedkarma/gemma-4-finetune-finetome10k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "delayedkarma/gemma-4-finetune-finetome10k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/delayedkarma/gemma-4-finetune-finetome10k
- SGLang
How to use delayedkarma/gemma-4-finetune-finetome10k with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "delayedkarma/gemma-4-finetune-finetome10k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "delayedkarma/gemma-4-finetune-finetome10k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "delayedkarma/gemma-4-finetune-finetome10k" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "delayedkarma/gemma-4-finetune-finetome10k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use delayedkarma/gemma-4-finetune-finetome10k 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 delayedkarma/gemma-4-finetune-finetome10k 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 delayedkarma/gemma-4-finetune-finetome10k to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for delayedkarma/gemma-4-finetune-finetome10k to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="delayedkarma/gemma-4-finetune-finetome10k", max_seq_length=2048, ) - Docker Model Runner
How to use delayedkarma/gemma-4-finetune-finetome10k with Docker Model Runner:
docker model run hf.co/delayedkarma/gemma-4-finetune-finetome10k
Original Unsloth Finetuning Resources:: https://unsloth.ai/docs/models/gemma-4/train
gemma-4-finetune-finetome10k
A merged, instruction-tuned fine-tune of Gemma 4 E4B trained with Unsloth and TRL on a cleaned conversational subset of FineTome-style data.
Model description
This model is a supervised fine-tune of unsloth/gemma-4-e4b-it-unsloth-bnb-4bit for general-purpose text instruction following and assistant-style responses.
Although the underlying architecture supports multimodal prompting, this fine-tuning run was performed on text-only conversational data. Best results are obtained with chat-formatted prompts using the tokenizer chat template.
- Base model:
unsloth/gemma-4-e4b-it-unsloth-bnb-4bit - Fine-tuning framework: Unsloth + Hugging Face TRL
- Training type: Supervised fine-tuning (SFT)
- Model format: merged fine-tuned checkpoint
- Primary language: English
Intended use
This model is intended for:
- general instruction following
- conversational Q&A
- writing assistance
- basic programming help
- experimentation with Gemma 4 fine-tuning workflows
Training data
This model was fine-tuned on a conversational instruction/response dataset:: 10k rows of Maxime Labonne's FineTome-100k dataset in ShareGPT style(https://huggingface.co/datasets/mlabonne/FineTome-100k)
Gemma-4 renders multi turn conversations like below:
- <|turn>user
- Hello<turn|>
- <|turn>model
- Hey there!<turn|>
The training data was normalized into alternating user / assistant turns before formatting with the Gemma chat template. Invalid or malformed conversations were filtered during preprocessing.
Data characteristics
- conversational instruction-response format
- predominantly English
- text-only fine-tuning data
- general-purpose assistant-style examples
Training procedure
The model was fine-tuned using LoRA adapters and later exported as a merged model.
Preprocessing
The source data used ShareGPT-style fields such as:
from: humanfrom: gpt
These were converted into standard chat roles:
userassistant
Conversations were cleaned to ensure valid alternating turns before being serialized with the Gemma chat template.
Training configuration
- Training objective: supervised fine-tuning
- Epochs: 1
- Training examples: 10,000
- Per-device batch size: 4
- Gradient accumulation steps: 4
- Effective batch size: 16
- Warmup steps: 250
- Learning rate: 5e-5
- Optimizer: AdamW 8-bit
- Scheduler: cosine
- Precision: bf16
- Hardware: Google Colab G4 GPU
Prompting / usage notes
This model performs best when prompted in chat format, not as a plain raw completion prompt.
Recommended usage
Use tokenizer.apply_chat_template(..., add_generation_prompt=True) before generation.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "<username>/gemma-4-finetune-finetome10k"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto"
)
messages = [
{"role": "user", "content": "Explain what a modulus operator is in programming."}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
return_dict=True
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=200,
do_sample=True,
temperature=0.7,
top_p=0.9
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 3