Instructions to use turquise/MedQA_q4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use turquise/MedQA_q4 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="turquise/MedQA_q4", filename="MedQA.Q4_K_M.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use turquise/MedQA_q4 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf turquise/MedQA_q4:Q4_K_M # Run inference directly in the terminal: llama-cli -hf turquise/MedQA_q4:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf turquise/MedQA_q4:Q4_K_M # Run inference directly in the terminal: llama-cli -hf turquise/MedQA_q4:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf turquise/MedQA_q4:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf turquise/MedQA_q4:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf turquise/MedQA_q4:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf turquise/MedQA_q4:Q4_K_M
Use Docker
docker model run hf.co/turquise/MedQA_q4:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use turquise/MedQA_q4 with Ollama:
ollama run hf.co/turquise/MedQA_q4:Q4_K_M
- Unsloth Studio new
How to use turquise/MedQA_q4 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 turquise/MedQA_q4 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 turquise/MedQA_q4 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for turquise/MedQA_q4 to start chatting
- Docker Model Runner
How to use turquise/MedQA_q4 with Docker Model Runner:
docker model run hf.co/turquise/MedQA_q4:Q4_K_M
- Lemonade
How to use turquise/MedQA_q4 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull turquise/MedQA_q4:Q4_K_M
Run and chat with the model
lemonade run user.MedQA_q4-Q4_K_M
List all available models
lemonade list
Fine-Tuning Llama-3.1 with Comprehensive Medical Q&A Dataset
This project fine-tunes the Llama-3.1 8B Model using the Comprehensive Medical Q&A Dataset to build a specialized model capable of answering medical questions.
π Features
- Fine-tuned on a diverse dataset of over 43,000 medical Q&A pairs.
- Supports 31 distinct types of medical queries, including treatments, chronic diseases, and protocols.
- Provides answers sourced from doctors, nurses, and pharmacists.
π Dataset Overview
Comprehensive Medical Q&A Dataset
- Source: Huggingface Hub
- License: CC0 1.0 Universal (Public Domain Dedication)
Key Details
- Total Questions: 43,000+
- Categories: 31 medical question types (
qtype) - Columns:
qtype: Type of medical question (e.g., Treatment, Symptoms).Question: Patient's medical question.Answer: Expert response (from doctors, nurses, and pharmacists).
How the Dataset is Used
- Filtering: Questions are filtered by
qtypefor domain-specific fine-tuning. - Analysis: Queries are analyzed to understand patterns, such as correlations between treatments and chronic conditions.
- Applications: Insights can be applied to build medical educational tools, predictive models, and virtual assistants.
For more details, check the dataset documentation.
π» How to Use This Model
The fine-tuned model is available on Hugging Face under the repository: turquise/MedQA_q4. Below are several ways to use the model:
Using llama-cpp-python Library
from llama_cpp import Llama
# Load the model
llm = Llama.from_pretrained(
repo_id="turquise/MedQA_q4",
filename="MedQA.Q4_K_M.gguf",
)
# Query the model
output = llm(
"What is Medullary Sponge Kidney?",
max_tokens=512,
echo=True
)
print(output)
Using llama.cpp
Install via Homebrew
brew install llama.cpp
llama-cli \
--hf-repo "turquise/MedQA_q4" \
--hf-file MedQA.Q4_K_M.gguf \
-p "What is Medullary Sponge Kidney?"
Use Pre-Built Binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases
./llama-cli \
--hf-repo "turquise/MedQA_q4" \
--hf-file MedQA.Q4_K_M.gguf \
-p "What is Medullary Sponge Kidney?"
Build from Source Code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build -DLLAMA_CURL=ON
cmake --build build -j --target llama-cli
./build/bin/llama-cli \
--hf-repo "turquise/MedQA_q4" \
--hf-file MedQA.Q4_K_M.gguf \
-p "What is Medullary Sponge Kidney?"
π€ Example Usages
This model can assist with the following tasks:
- Answering medical questions:
question = "What are the symptoms of diabetes?"
output = llm(question, max_tokens=512)
print(output)
- Providing insights for healthcare education: Example: Answering queries about diseases, treatments, and chronic conditions.
- Supporting virtual assistants by handling frequently asked healthcare-related questions.
β οΈ Disclaimer
- This model does not provide medical advice and should not replace professional medical consultation.
- For any health-related questions or concerns, please consult a doctor or a licensed healthcare professional.
π€ Applications
This fine-tuned model can be used to:
- Build virtual assistants and chatbots for healthcare-related queries.
- Assist healthcare professionals by handling routine inquiries.
- Enhance medical education platforms with AI-powered insights.
π Acknowledgements
- Dataset: Huggingface Hub - MedQuad.
- Fine-tuning framework: Unsloth.
If you use this project or dataset in your research, please credit the original authors.
π License
This project is open-sourced under the CC0 1.0 Universal License. See the dataset license details.
π§ Contact
For questions or collaboration, reach out via HF Model Community.
- Downloads last month
- 17
4-bit
Model tree for turquise/MedQA_q4
Base model
meta-llama/Llama-3.1-8B