Text Generation
Transformers
Safetensors
PEFT
English
tinyllama
sciq
multiple-choice
lora
4bit
quantization
instruction-tuning
conversational
How to use from
SGLangUse 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 "TechyCode/tinyllama-sciq-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": "TechyCode/tinyllama-sciq-lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'Quick Links
π§ TinyLLaMA-1.1B LoRA Fine-tuned on SciQ Dataset
This is a TinyLLaMA-1.1B model fine-tuned using LoRA (Low-Rank Adaptation) on the SciQ multiple-choice question answering dataset. It uses 4-bit quantization via bitsandbytes to reduce memory usage and improve inference efficiency.
π§ͺ Use Cases
This model is suitable for:
- Educational QA bots
- MCQ-style reasoning
- Lightweight inference on constrained hardware (e.g., GPUs with <8GB VRAM)
π οΈ Training Details
- Base Model:
TinyLlama/TinyLlama-1.1B-Chat-v1.0 - Dataset:
allenai/sciq(Science QA) - Method: Parameter-Efficient Fine-Tuning using LoRA
- Quantization: 4-bit using
bitsandbytes - Framework: π€ Transformers + PEFT + Datasets
𧬠Model Architecture
- Model: Causal Language Model
- Fine-tuned layers:
q_proj,v_proj(via LoRA) - Quantization: 4-bit (bnb config)
π Evaluation
- Accuracy: 100% on a 1000-sample SciQ subset
- Eval Loss: ~0.19
π‘ How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("TechyCode/tinyllama-sciq-lora")
tokenizer = AutoTokenizer.from_pretrained("TechyCode/tinyllama-sciq-lora")
prompt = """Question: What is the boiling point of water?\nChoices:\nA. 50Β°C\nB. 75Β°C\nC. 90Β°C\nD. 100Β°C\nAnswer:"""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=20)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
π License
This model is released under the MIT License.
π Credits
FineTuned By - Uditanshu Pandey
Linkedin - UditanshuPandey
GitHub - UditanshuPandey
Based on - TinyLLaMA-1.1B-Chat-v1.0
Install from pip and serve model
# Install SGLang from pip: pip install sglang# Start the SGLang server: python3 -m sglang.launch_server \ --model-path "TechyCode/tinyllama-sciq-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": "TechyCode/tinyllama-sciq-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'