GGUF
English
llama
medical
Inference Endpoints

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 qtype for 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

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
47
GGUF
Model size
8.03B params
Architecture
llama

4-bit

Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and HF Inference API was unable to determine this model's library.

Model tree for turquise/MedQA_q4

Quantized
(328)
this model

Dataset used to train turquise/MedQA_q4