Instructions to use HexQuant/Pars-Medical-o1-Llama-FFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HexQuant/Pars-Medical-o1-Llama-FFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HexQuant/Pars-Medical-o1-Llama-FFT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HexQuant/Pars-Medical-o1-Llama-FFT") model = AutoModelForCausalLM.from_pretrained("HexQuant/Pars-Medical-o1-Llama-FFT") 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
- vLLM
How to use HexQuant/Pars-Medical-o1-Llama-FFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HexQuant/Pars-Medical-o1-Llama-FFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HexQuant/Pars-Medical-o1-Llama-FFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HexQuant/Pars-Medical-o1-Llama-FFT
- SGLang
How to use HexQuant/Pars-Medical-o1-Llama-FFT 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 "HexQuant/Pars-Medical-o1-Llama-FFT" \ --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": "HexQuant/Pars-Medical-o1-Llama-FFT", "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 "HexQuant/Pars-Medical-o1-Llama-FFT" \ --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": "HexQuant/Pars-Medical-o1-Llama-FFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use HexQuant/Pars-Medical-o1-Llama-FFT 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 HexQuant/Pars-Medical-o1-Llama-FFT 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 HexQuant/Pars-Medical-o1-Llama-FFT to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for HexQuant/Pars-Medical-o1-Llama-FFT to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="HexQuant/Pars-Medical-o1-Llama-FFT", max_seq_length=2048, ) - Docker Model Runner
How to use HexQuant/Pars-Medical-o1-Llama-FFT with Docker Model Runner:
docker model run hf.co/HexQuant/Pars-Medical-o1-Llama-FFT
- 🩺 Pars-Medical-o1-Llama-FFT
- ⚠️This is a beta version and does not have the ability to correctly respond to or handle local runs on its own.⚠️
🩺 Pars-Medical-o1-Llama-FFT
⚠️This is a beta version and does not have the ability to correctly respond to or handle local runs on its own.⚠️
⚠️The full version will be released in the Pars-Medical application.⚠️
اولین مدل پزشکی دوزبانه فارسی-انگلیسی با استدلال زنجیرهای
First Bilingual Persian-English Medical Model with Chain-of-Thought Reasoning
🌟 Overview | معرفی
|
پارس-مدیکال یک مدل هوش مصنوعی پزشکی است که با روش Full Fine-Tune روی مجموعه دادههای پزشکی فارسی و انگلیسی آموزش دیده است. این مدل از تکنیک Chain-of-Thought (استدلال زنجیرهای) مشابه مدلهای o1 استفاده میکند تا پاسخهای دقیقتر و منطقیتر ارائه دهد. |
Pars-Medical is a medical AI model trained with Full Fine-Tuning on Persian and English medical datasets. It uses Chain-of-Thought reasoning (similar to o1-style models) to provide more accurate and logical responses. |
✨ Features | ویژگیها
| Feature | Description | توضیحات |
|---|---|---|
| 🌐 | Bilingual - Persian & English | دوزبانه - فارسی و انگلیسی |
| 🧠 | Chain-of-Thought - Step-by-step reasoning | استدلال زنجیرهای - گام به گام |
| 🔬 | Full Fine-Tune - Not LoRA/adapter | آموزش کامل - نه آداپتور |
| 📊 | 48K+ Samples - Large medical dataset | +۴۸ هزار نمونه - دیتاست بزرگ |
| ⚡ | 3B Parameters - Fast inference | ۳ میلیارد پارامتر - استنتاج سریع |
| 🏥 | Clinical Focus - Diagnosis & treatment | تمرکز بالینی - تشخیص و درمان |
🚀 Quick Start | شروع سریع
Using Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "HexQuant/Pars-Medical-o1-Llama-FFT"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
messages = [
{"role": "user", "content": "علائم دیابت نوع ۲ چیست؟"}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
outputs = model.generate(inputs, max_new_tokens=512, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Using Ollama (GGUF)
# Use quantized version for local inference
ollama run hf.co/HexQuant/Pars-Medical-o1-Llama-FFT-GGUF
📦 Looking for GGUF? See Pars-Medical-o1-Llama-FFT-GGUF for quantized versions.
💬 Example | نمونه
🇮🇷 مثال فارسی - تشخیص پزشکی
User:
یک مرد ۵۵ ساله با درد قفسه سینه، تنگی نفس و تعریق مراجعه کرده است. علائم از ۲ ساعت پیش شروع شده. تشخیص احتمالی چیست؟
Model:
<think>بیایید این مورد را گام به گام بررسی کنیم:۱. مشخصات بیمار: مرد ۵۵ ساله - در گروه سنی پرخطر برای بیماریهای قلبی
۲. علائم کلیدی:
- درد قفسه سینه (علامت کلاسیک)
- تنگی نفس (نشانه اختلال عملکرد قلب)
- تعریق (فعال شدن سیستم سمپاتیک)
۳. شروع حاد: ۲ ساعت پیش - نشاندهنده وضعیت اورژانسی
۴. تشخیص افتراقی:
- سندرم حاد کرونری (ACS) ⚠️ محتملترین
- آمبولی ریه
- دیسکسیون آئورت
</think>تشخیص احتمالی: سندرم حاد کرونری (Acute Coronary Syndrome)
اقدامات فوری توصیه شده:
- ECG فوری (در ۱۰ دقیقه اول)
- تروپونین و آنزیمهای قلبی
- آسپرین ۳۲۵ میلیگرم
- مشاوره قلب اورژانسی
🇺🇸 English Example - Clinical Reasoning
User:
A 45-year-old woman presents with fatigue, weight gain, cold intolerance, and constipation for 3 months. What is the likely diagnosis?
Model:
<think>Let me analyze this systematically:
Patient Profile: 45-year-old female - higher risk for thyroid disorders
Symptom Analysis:
- Fatigue → decreased metabolic rate
- Weight gain → slowed metabolism
- Cold intolerance → reduced thermogenesis
- Constipation → decreased GI motility
Pattern Recognition: All symptoms point to hypometabolic state
Most Likely Cause: These are classic signs of decreased thyroid hormone
</think>Likely Diagnosis: Hypothyroidism
Recommended workup:
- TSH (primary screening test)
- Free T4
- Anti-TPO antibodies (if Hashimoto's suspected)
- Lipid panel (dyslipidemia common in hypothyroidism)
📊 Training Details | جزئیات آموزش
| Parameter | Value |
|---|---|
| Base Model | Llama-3.2-3B-Instruct |
| Method | Full Fine-Tune (FFT) |
| Framework | Unsloth + Transformers |
| Precision | BF16 |
| Context Length | 4096 tokens |
| Training Hardware | NVIDIA A100 80GB |
Datasets | دیتاستها
| Dataset | Language | Samples |
|---|---|---|
| medical-o1-reasoning-SFT | English | ~40,000 |
| persian-medical-qa | Persian | ~5,000 |
| Persian-Medical-Dataset | Persian | ~3,000 |
📦 Available Formats | فرمتهای موجود
| Format | Size | Use Case | Link |
|---|---|---|---|
| BF16 (This repo) | ~6.4 GB | Fine-tuning, Full precision | Download |
| GGUF Q4_K_M | ~2.0 GB | Ollama, llama.cpp, LM Studio | Download |
| GGUF Q5_K_M | ~2.5 GB | Better quality, local use | Download |
| GGUF Q8_0 | ~3.5 GB | Best quality quantized | Download |
⚠️ Disclaimer | سلب مسئولیت
|
⚠️ این مدل صرفاً برای اهداف آموزشی و تحقیقاتی طراحی شده است. ❌ جایگزین مشاوره پزشکی حرفهای نیست. ✅ همیشه با پزشک متخصص مشورت کنید. |
⚠️ This model is for educational and research purposes only. ❌ Not a substitute for professional medical advice. ✅ Always consult with a qualified healthcare provider. |
🔗 Connect | ارتباط
- Downloads last month
- 5
