Instructions to use Siddharth466/tinyllama-gsm8k-math-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Siddharth466/tinyllama-gsm8k-math-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Siddharth466/tinyllama-gsm8k-math-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Siddharth466/tinyllama-gsm8k-math-lora", dtype="auto") - PEFT
How to use Siddharth466/tinyllama-gsm8k-math-lora with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Siddharth466/tinyllama-gsm8k-math-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Siddharth466/tinyllama-gsm8k-math-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": "Siddharth466/tinyllama-gsm8k-math-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Siddharth466/tinyllama-gsm8k-math-lora
- SGLang
How to use Siddharth466/tinyllama-gsm8k-math-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 "Siddharth466/tinyllama-gsm8k-math-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": "Siddharth466/tinyllama-gsm8k-math-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 "Siddharth466/tinyllama-gsm8k-math-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": "Siddharth466/tinyllama-gsm8k-math-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Siddharth466/tinyllama-gsm8k-math-lora with Docker Model Runner:
docker model run hf.co/Siddharth466/tinyllama-gsm8k-math-lora
TinyLlama GSM8K Math Fine-Tuned (QLoRA)
This model is a LoRA fine-tuned adapter built on top of:
Base Model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
Dataset: GSM8K (Grade School Math 8K)
Fine-tuning Method: QLoRA (4-bit quantization + LoRA)
It improves step-by-step mathematical reasoning and structured problem-solving.
Training Details
- Base Model: TinyLlama-1.1B-Chat
- Method: QLoRA (4-bit NF4 quantization)
- LoRA Rank (r): 16
- LoRA Alpha: 32
- LoRA Dropout: 0.05
- Epochs: 3
- Learning Rate: 2e-4
- Optimizer: paged_adamw_8bit
- Scheduler: Cosine
- Max Sequence Length: 512
- Dataset: GSM8K (train split)
Comparision
Evaluating Base TinyLlama...
100%|ββββββββββ| 165/165 [12:35<00:00, 4.58s/it] Base TinyLlama Accuracy: 1.29%
Evaluating Fine-Tuned (Merged)...
100%|ββββββββββ| 165/165 [12:40<00:00, 4.61s/it] Fine-Tuned (Merged) Accuracy: 1.90%
Training was performed using:
- Transformers
- PEFT
- TRL SFTTrainer
- BitsAndBytes
Model tree for Siddharth466/tinyllama-gsm8k-math-lora
Base model
TinyLlama/TinyLlama-1.1B-Chat-v1.0