Instructions to use JDhruv14/Qwen2.5-3B-Gita-FT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JDhruv14/Qwen2.5-3B-Gita-FT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="JDhruv14/Qwen2.5-3B-Gita-FT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("JDhruv14/Qwen2.5-3B-Gita-FT") model = AutoModelForMultimodalLM.from_pretrained("JDhruv14/Qwen2.5-3B-Gita-FT") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use JDhruv14/Qwen2.5-3B-Gita-FT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "JDhruv14/Qwen2.5-3B-Gita-FT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JDhruv14/Qwen2.5-3B-Gita-FT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/JDhruv14/Qwen2.5-3B-Gita-FT
- SGLang
How to use JDhruv14/Qwen2.5-3B-Gita-FT 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 "JDhruv14/Qwen2.5-3B-Gita-FT" \ --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": "JDhruv14/Qwen2.5-3B-Gita-FT", "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 "JDhruv14/Qwen2.5-3B-Gita-FT" \ --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": "JDhruv14/Qwen2.5-3B-Gita-FT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use JDhruv14/Qwen2.5-3B-Gita-FT 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 JDhruv14/Qwen2.5-3B-Gita-FT 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 JDhruv14/Qwen2.5-3B-Gita-FT to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for JDhruv14/Qwen2.5-3B-Gita-FT to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="JDhruv14/Qwen2.5-3B-Gita-FT", max_seq_length=2048, ) - Docker Model Runner
How to use JDhruv14/Qwen2.5-3B-Gita-FT with Docker Model Runner:
docker model run hf.co/JDhruv14/Qwen2.5-3B-Gita-FT
Qwen2.5-3B-Gita-FT
A Bhagavad Gita–focused assistant that adopts a Krishna-inspired teaching persona for guiding in your spiritual path.
🌟 Model Description
Qwen2.5-3B-Gita-FT is a LoRA-tuned model built on Qwen/Qwen2.5-3B-Instruct, focused on tasks around the Bhagavad Gītā. It supports:
- Krishna-inspired persona: Calm, compassionate, and practical tone for guidance and teaching.
- Commentary Q&A — approachable explanations of concepts (e.g., niṣkāma-karma, guṇa theory), in a Krishna-like tone.
Important: The model is not Krishna, nor a religious authority. It patterns its style from training data and prompts. It can make mistakes, simplify nuanced ideas, misremember verse numbers, or produce non-canonical wording. For study or citation, please verify with authoritative editions and scholars.
🚀 Key Features
- Commentary tone control: System prompts steer classical or modern explanatory style.
- Resource efficient: LoRA adapters with mixed precision; optional 4-bit inference.
📊 Model Specs
| Parameter | Value |
|---|---|
| Base Model | Qwen/Qwen2.5-3B-Instruct |
| Fine-tuning | LoRA (rank=16, alpha=32) |
| Seq Length | 1024 (recommend ≥ 512 for long verses) |
| Epochs | 3 |
| LR | 2e-4 |
| Batch | 2 (micro) × 4 (grad acc) |
| Optimizer | AdamW 8-bit |
| Precision | bf16 (training & inference where available) |
🎯 Intended Uses
✅ Recommended
- Study aids for verse comprehension, transliteration, and quick glosses.
- Educational apps and assistive tools for learners.
- Search & summarize experiences for specific verses and concepts.
⚠️ Limitations
- Interpretation variance: Philosophical terms can have multiple valid readings.
- Historical/cultural nuance: May miss context without retrieval.
- Hallucinations: Makes a lot of mistakes while generating Hindi and Gujarati
🛠️ Quickstart (Transformers)
Requires
transformers>=4.41,torch,accelerate. Some Qwen models needtrust_remote_code=True.
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "JDhruv14/Qwen2.5-3B-Gita-FT"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Prepare the conversation
messages = [
{
"role": "system",
"content": "You are Lord Krishna—the serene, compassionate teacher of the Bhagavad Gita."
},
{
"role": "user",
"content": "Hey Keshav, what's my dharma?"
}
]
# Apply chat template and generate
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
response = tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True)
📚 Citation
@misc{gita-qwen-assistant,
title={Gita-qwen-3B-Assistan: A Bhagavad Gītā-focused model for motivating you, guiding you based on the eternal guidance of Madhav.},
author={JDhruv14},
year={2025},
url={https://huggingface.co/JDhruv14/Qwen2.5-3B-Gita-FT}
}
🤝 Contributing
- Add verse-aligned examples, domain-checked glosses, and evaluation sets.
- Propose prompt templates for specific chapters/themes (e.g., Karma-yoga, Bhakti-yoga).
- Open issues/PRs for bugs or inaccuracies.
📄 License
Released under Apache 2.0. See LICENSE.
- Downloads last month
- 10