Instructions to use Aman0026/ArogyaAI-LLaMA3-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Aman0026/ArogyaAI-LLaMA3-8B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct") model = PeftModel.from_pretrained(base_model, "Aman0026/ArogyaAI-LLaMA3-8B") - Transformers
How to use Aman0026/ArogyaAI-LLaMA3-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Aman0026/ArogyaAI-LLaMA3-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Aman0026/ArogyaAI-LLaMA3-8B", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Aman0026/ArogyaAI-LLaMA3-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Aman0026/ArogyaAI-LLaMA3-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Aman0026/ArogyaAI-LLaMA3-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Aman0026/ArogyaAI-LLaMA3-8B
- SGLang
How to use Aman0026/ArogyaAI-LLaMA3-8B 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 "Aman0026/ArogyaAI-LLaMA3-8B" \ --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": "Aman0026/ArogyaAI-LLaMA3-8B", "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 "Aman0026/ArogyaAI-LLaMA3-8B" \ --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": "Aman0026/ArogyaAI-LLaMA3-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Aman0026/ArogyaAI-LLaMA3-8B with Docker Model Runner:
docker model run hf.co/Aman0026/ArogyaAI-LLaMA3-8B
π₯ ArogyaAI - LLaMA3 8B Fine-Tuned (QLoRA)
This is the fine-tuned LLaMA3 8B Instruct model adapter developed as part of ArogyaAI (India's First Multimodal AI Health Intelligence Platform). It has been SFT fine-tuned to synthesize unified prescriptions and diagnosis advice combining Allopathy, Ayurveda, and Homeopathy across 7 Indian languages.
π Fine-Tuning Performance & Metrics
The model was fine-tuned on a dual NVIDIA H100 GPU cluster. Below are the final metrics achieved during SFT training:
- Training Dataset Size: 1,705 medical Q&A instruction pairs
- Training Duration: 19 minutes, 59 seconds (5 epochs)
- Final Training Loss:
0.2194 - Final Evaluation Loss:
0.3728 - Mean Token Evaluation Accuracy:
92.15%(Significantly exceeding the 80% thesis target!)
Framework versions
- PEFT: 0.19.1
- TRL: 1.6.0
- Transformers: 5.12.1
- Pytorch: 2.5.1+cu121
- Datasets: 5.0.0
- Tokenizers: 0.22.2
𧬠Direct Usage (PEFT & Transformers)
To load and use this model locally with the base LLaMA3 model:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_name = "meta-llama/Meta-Llama-3-8B-Instruct"
adapter_model_name = "Aman0026/ArogyaAI-LLaMA3-8B"
# Load base model in 4-bit
model = AutoModelForCausalLM.from_pretrained(
base_model_name,
load_in_4bit=True,
torch_dtype=torch.float16,
device_map="auto"
)
# Load tokenizer and merge PEFT adapter
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
model = PeftModel.from_pretrained(model, adapter_model_name)
# Run inference
inputs = tokenizer("Patient presents with severe cold and coughing. Suggest remedy.", return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
π Citations & License
This project is licensed under the MIT License.
- Downloads last month
- 95
Model tree for Aman0026/ArogyaAI-LLaMA3-8B
Base model
meta-llama/Meta-Llama-3-8B-Instruct