Instructions to use Tohidichi/gemma3-genz-270m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Tohidichi/gemma3-genz-270m with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-3-270m-it") model = PeftModel.from_pretrained(base_model, "Tohidichi/gemma3-genz-270m") - Transformers
How to use Tohidichi/gemma3-genz-270m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tohidichi/gemma3-genz-270m") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Tohidichi/gemma3-genz-270m", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Tohidichi/gemma3-genz-270m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Tohidichi/gemma3-genz-270m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tohidichi/gemma3-genz-270m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Tohidichi/gemma3-genz-270m
- SGLang
How to use Tohidichi/gemma3-genz-270m 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 "Tohidichi/gemma3-genz-270m" \ --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": "Tohidichi/gemma3-genz-270m", "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 "Tohidichi/gemma3-genz-270m" \ --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": "Tohidichi/gemma3-genz-270m", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Tohidichi/gemma3-genz-270m with Docker Model Runner:
docker model run hf.co/Tohidichi/gemma3-genz-270m
Gemma 3 270M Fine-Tuned with LoRA
This model is a fine-tuned derivative of Google's Gemma 3 270M using LoRA. fp32 version.
It was fine-tuned by Toheed Akhtar on a small dataset of Gen Z conversations in Hinglish, focusing on casual interactions among college students.
fp16 one is here : link to fp16
Model Details
- Developed by: Toheed Akhtar
- Model type: Causal Language Model (text-generation)
- Language(s): Multilingual (Hinglish focus)
- License: Subject to Gemma Terms of Use
- Finetuned from model: google/gemma-3-270m-it
Intended Use
This model is designed for casual text generation, simulating informal Gen Z conversations in Hinglish. It is mainly intended for personal experimentation.
Out-of-Scope Use
- The model may not produce accurate or safe content for critical applications.
How to Get Started
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
from peft import PeftModel
# Set device for pipeline
device = 0 if torch.cuda.is_available() else -1 # 0 = first GPU, -1 = CPU
# Load base model
base_model_name = "google/gemma-3-270m-it"
base_model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype=torch.float16
)
# Load PEFT LoRA fine-tuned model from Hugging Face Hub
peft_model_hf = "Tohidichi/gemma3-genz-270m"
model = PeftModel.from_pretrained(base_model, peft_model_hf)
model.eval()
# Load tokenizer from the PEFT model repo
tokenizer = AutoTokenizer.from_pretrained(peft_model_hf)
# Create text-generation pipeline
text_gen_pipeline = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
device=device
)
- Downloads last month
- 1