Instructions to use Tushar1K/gemma-function-calling-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tushar1K/gemma-function-calling-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tushar1K/gemma-function-calling-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Tushar1K/gemma-function-calling-lora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Tushar1K/gemma-function-calling-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Tushar1K/gemma-function-calling-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tushar1K/gemma-function-calling-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Tushar1K/gemma-function-calling-lora
- SGLang
How to use Tushar1K/gemma-function-calling-lora 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 "Tushar1K/gemma-function-calling-lora" \ --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": "Tushar1K/gemma-function-calling-lora", "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 "Tushar1K/gemma-function-calling-lora" \ --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": "Tushar1K/gemma-function-calling-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Tushar1K/gemma-function-calling-lora 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 Tushar1K/gemma-function-calling-lora 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 Tushar1K/gemma-function-calling-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Tushar1K/gemma-function-calling-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Tushar1K/gemma-function-calling-lora", max_seq_length=2048, ) - Docker Model Runner
How to use Tushar1K/gemma-function-calling-lora with Docker Model Runner:
docker model run hf.co/Tushar1K/gemma-function-calling-lora
| license: apache-2.0 | |
| base_model: google/gemma-2b | |
| tags: | |
| - gemma | |
| - lora | |
| - qlora | |
| - instruction-tuning | |
| - unsloth | |
| - transformers | |
| - text-generation | |
| library_name: transformers | |
| - **Developed by:** Tushar Kamthe | |
| - **License:** apache-2.0 | |
| - **Finetuned from model :** unsloth/gemma-2-2b-it-bnb-4bit | |
| - | |
| # Gemma-2B QLoRA Fine-tuned Model | |
| ## Model Description | |
| This model is a fine-tuned version of **Google's Gemma-2B** using the **QLoRA (Quantized Low-Rank Adaptation)** technique. The model was trained using **parameter-efficient fine-tuning (PEFT)**, where only LoRA adapters were trained while keeping the base model weights frozen. | |
| The model is designed for **instruction-following text generation tasks**. | |
| Fine-tuning was performed using: | |
| - QLoRA (4-bit quantization) | |
| - LoRA adapters | |
| - HuggingFace Transformers | |
| - PEFT | |
| - Unsloth for faster training | |
| --- | |
| ## Base Model | |
| Base model used for training: | |
| google/gemma-2b | |
| --- | |
| ## Training Details | |
| ### Training Method | |
| The model was trained using **QLoRA**, which enables efficient training of large language models by: | |
| - Loading the base model in **4-bit quantized format** | |
| - Training **LoRA adapter weights only** | |
| - Keeping base model weights frozen | |
| This significantly reduces GPU memory requirements. | |
| --- | |
| ### Training Configuration | |
| | Parameter | Value | | |
| |--------|--------| | |
| | Method | QLoRA | | |
| | Quantization | 4-bit (NF4) | | |
| | LoRA Rank (r) | 16 | | |
| | LoRA Alpha | 64 | | |
| | LoRA Dropout | 0.05 | | |
| | Optimizer | AdamW | | |
| | Precision | bfloat16 | | |
| | Framework | HuggingFace Transformers | | |
| --- | |
| ### Hardware | |
| Training was performed on: | |
| - GPU: NVIDIA GPU (Colab / Local GPU) | |
| - Framework: PyTorch | |
| - Libraries: | |
| - transformers | |
| - peft | |
| - datasets | |
| - unsloth | |
| --- | |
| ## Dataset | |
| The model was fine-tuned on a **custom instruction dataset** containing prompt-response pairs. | |
| Dataset format: | |