Text Generation
Transformers
Safetensors
English
Hindi
Sanskrit
llama
ayurveda
medical
biology
llama-3.2
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use Vivekdas/VaidhLLaMA-3.2-3B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Vivekdas/VaidhLLaMA-3.2-3B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Vivekdas/VaidhLLaMA-3.2-3B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Vivekdas/VaidhLLaMA-3.2-3B-Instruct") model = AutoModelForCausalLM.from_pretrained("Vivekdas/VaidhLLaMA-3.2-3B-Instruct") 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 Vivekdas/VaidhLLaMA-3.2-3B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Vivekdas/VaidhLLaMA-3.2-3B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vivekdas/VaidhLLaMA-3.2-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Vivekdas/VaidhLLaMA-3.2-3B-Instruct
- SGLang
How to use Vivekdas/VaidhLLaMA-3.2-3B-Instruct 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 "Vivekdas/VaidhLLaMA-3.2-3B-Instruct" \ --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": "Vivekdas/VaidhLLaMA-3.2-3B-Instruct", "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 "Vivekdas/VaidhLLaMA-3.2-3B-Instruct" \ --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": "Vivekdas/VaidhLLaMA-3.2-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Vivekdas/VaidhLLaMA-3.2-3B-Instruct with Docker Model Runner:
docker model run hf.co/Vivekdas/VaidhLLaMA-3.2-3B-Instruct
Add Model Card (README.md)
#1
by wellwisherofindia - opened
README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- hi
|
| 5 |
+
- sa
|
| 6 |
+
license: llama3.2
|
| 7 |
+
library_name: transformers
|
| 8 |
+
tags:
|
| 9 |
+
- ayurveda
|
| 10 |
+
- medical
|
| 11 |
+
- biology
|
| 12 |
+
- llama-3.2
|
| 13 |
+
- text-generation
|
| 14 |
+
base_model: meta-llama/Llama-3.2-3B-Instruct
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
+
model-index:
|
| 17 |
+
- name: VaidhLLaMA-3.2-3B-Instruct
|
| 18 |
+
results:
|
| 19 |
+
- task:
|
| 20 |
+
type: text-generation
|
| 21 |
+
name: Text Generation
|
| 22 |
+
dataset:
|
| 23 |
+
name: BhashaBench-Ayur
|
| 24 |
+
type: evaluation-suite
|
| 25 |
+
metrics:
|
| 26 |
+
- name: Accuracy (Zero-Shot)
|
| 27 |
+
type: accuracy
|
| 28 |
+
value: 41.91
|
| 29 |
+
verified: false
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
# VaidhLLaMA-3.2-3B-Instruct
|
| 33 |
+
|
| 34 |
+
**VaidhLLaMA-3.2-3B-Instruct** is a specialized Large Language Model fine-tuned for the domain of **Ayurveda**. It is built upon the Llama-3.2-3B-Instruct architecture and has been optimized to understand and reason with Ayurvedic concepts, physiology (*Sharir Kriya*), and clinical applications.
|
| 35 |
+
|
| 36 |
+
## Model Details
|
| 37 |
+
|
| 38 |
+
* **Model Name:** VaidhLLaMA-3.2-3B-Instruct
|
| 39 |
+
* **Base Model:** [meta-llama/Llama-3.2-3B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct)
|
| 40 |
+
* **Developed By:** Vivekdas
|
| 41 |
+
* **Language:** English, Hindi, Sanskrit (Domain-specific terminology)
|
| 42 |
+
* **License:** Llama 3.2 Community License
|
| 43 |
+
* **Architecture:** Transformer-based Auto-Regressive Language Model
|
| 44 |
+
|
| 45 |
+
## Performance
|
| 46 |
+
|
| 47 |
+
VaidhLLaMA demonstrates strong performance on the **BhashaBench-Ayur** benchmark, outperforming its base model and other similarly sized models in domain-specific tasks.
|
| 48 |
+
|
| 49 |
+
| Model | Accuracy (%) | Note |
|
| 50 |
+
| :--- | :--- | :--- |
|
| 51 |
+
| **VaidhLLaMA-3.2-3B** | **41.91%** | **Fine-tuned Ayurveda Specialist** |
|
| 52 |
+
| Llama-3.2-3B-Instruct | 40.74% | Base Model |
|
| 53 |
+
| Llama-3.2-1B | 27.58% | Tiny Model |
|
| 54 |
+
|
| 55 |
+
## Intended Use
|
| 56 |
+
|
| 57 |
+
This model is designed for:
|
| 58 |
+
* Answering questions related to Ayurvedic medical science.
|
| 59 |
+
* Explaining concepts from classical Ayurvedic texts (*Samhitas*).
|
| 60 |
+
* Assisting researchers and students in the field of Ayurveda.
|
| 61 |
+
|
| 62 |
+
**Disclaimer:** This model is for **educational and research purposes only**. It should not be used as a substitute for professional medical advice, diagnosis, or treatment.
|
| 63 |
+
|
| 64 |
+
## Usage
|
| 65 |
+
|
| 66 |
+
You can run this model using the `transformers` library:
|
| 67 |
+
|
| 68 |
+
```python
|
| 69 |
+
import torch
|
| 70 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 71 |
+
|
| 72 |
+
model_id = "Vivekdas/VaidhLLaMA-3.2-3B-Instruct"
|
| 73 |
+
|
| 74 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 75 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 76 |
+
model_id,
|
| 77 |
+
torch_dtype=torch.bfloat16,
|
| 78 |
+
device_map="auto"
|
| 79 |
+
)
|
| 80 |
+
|
| 81 |
+
messages = [
|
| 82 |
+
{"role": "system", "content": "You are VaidhLLaMA, an expert AI assistant for Ayurveda."},
|
| 83 |
+
{"role": "user", "content": "Explain the concept of Tridosha in Ayurveda."}
|
| 84 |
+
]
|
| 85 |
+
|
| 86 |
+
input_ids = tokenizer.apply_chat_template(
|
| 87 |
+
messages,
|
| 88 |
+
add_generation_prompt=True,
|
| 89 |
+
return_tensors="pt"
|
| 90 |
+
).to(model.device)
|
| 91 |
+
|
| 92 |
+
outputs = model.generate(
|
| 93 |
+
input_ids,
|
| 94 |
+
max_new_tokens=512,
|
| 95 |
+
do_sample=True,
|
| 96 |
+
temperature=0.6,
|
| 97 |
+
top_p=0.9
|
| 98 |
+
)
|
| 99 |
+
|
| 100 |
+
response = tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True)
|
| 101 |
+
print(response)
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
## Citation
|
| 105 |
+
|
| 106 |
+
If you use this model in your research, please cite:
|
| 107 |
+
|
| 108 |
+
```bibtex
|
| 109 |
+
@misc{vaidhllama2024,
|
| 110 |
+
author = {Vivekdas},
|
| 111 |
+
title = {VaidhLLaMA: A Fine-Tuned LLM for Ayurveda},
|
| 112 |
+
year = {2024},
|
| 113 |
+
publisher = {Hugging Face},
|
| 114 |
+
journal = {Hugging Face Repository},
|
| 115 |
+
howpublished = {\url{https://huggingface.co/Vivekdas/VaidhLLaMA-3.2-3B-Instruct}}
|
| 116 |
+
}
|
| 117 |
+
```
|