Instructions to use ujjman/llama-3.2-3B-Medical-QnA-unsloth with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ujjman/llama-3.2-3B-Medical-QnA-unsloth with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("question-answering", model="ujjman/llama-3.2-3B-Medical-QnA-unsloth")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ujjman/llama-3.2-3B-Medical-QnA-unsloth", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ujjman/llama-3.2-3B-Medical-QnA-unsloth with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0 # Run inference directly in the terminal: llama cli -hf ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0 # Run inference directly in the terminal: llama cli -hf ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0
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 ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0
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 ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0
Use Docker
docker model run hf.co/ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0
- LM Studio
- Jan
- Ollama
How to use ujjman/llama-3.2-3B-Medical-QnA-unsloth with Ollama:
ollama run hf.co/ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0
- Unsloth Studio
How to use ujjman/llama-3.2-3B-Medical-QnA-unsloth 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 ujjman/llama-3.2-3B-Medical-QnA-unsloth 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 ujjman/llama-3.2-3B-Medical-QnA-unsloth to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ujjman/llama-3.2-3B-Medical-QnA-unsloth to start chatting
- Docker Model Runner
How to use ujjman/llama-3.2-3B-Medical-QnA-unsloth with Docker Model Runner:
docker model run hf.co/ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0
- Lemonade
How to use ujjman/llama-3.2-3B-Medical-QnA-unsloth with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ujjman/llama-3.2-3B-Medical-QnA-unsloth:Q8_0
Run and chat with the model
lemonade run user.llama-3.2-3B-Medical-QnA-unsloth-Q8_0
List all available models
lemonade list
- Atomic Chat
Model Card for MedQA LLM
This model is fine-tuned on the "keivalya/MedQuad-MedicalQnADataset" to provide accurate answers to medical queries, focusing on a variety of question types including symptoms, diagnosis, prevention, and treatment.
Model Details
Model Description
This model, built on LLaMA 3.2 3B, has been fine-tuned specifically to address question-answering tasks in the medical domain. It aims to assist healthcare providers, researchers, and the general public by offering detailed and accurate responses to queries about medical conditions and treatments.
- Developed by: Ujjwal Mishra
- Model type: Question-Answering on medical data
- Source Model: LLaMA 3.2 3B
Uses
This model is intended for use as a first-line information provider about medical queries. It can support digital health applications, help desks, and educational platforms.
Direct Use
The model can directly answer questions from users about medical issues without any further fine-tuning.
Downstream Use
This model can be further fine-tuned on more specific medical sub-domains or integrated into medical decision-support systems to enhance its utility.
Out-of-Scope Use
The model is not designed to replace professional medical advice or diagnostic activities by certified healthcare providers.
Bias, Risks, and Limitations
Due to the nature of its training data, the model might exhibit biases towards more commonly represented diseases or conditions. It may not perform equally well on rare conditions or non-English queries.
Recommendations
Users should verify the information provided by the model with up-to-date and peer-reviewed medical sources or professionals. The model should be continuously monitored and updated to mitigate biases and adapt to new medical knowledge.
How to Get Started with the Model
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
from accelerate import Accelerator
# Initialize the Accelerator for mixed precision and faster inference (if supported by your hardware)
accelerator = Accelerator()
# Load your fine-tuned model and tokenizer
model_name = "ujjman/llama-3.2-3B-Medical-QnA-unsloth"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Place model and tokenizer on the appropriate device
model, tokenizer = accelerator.prepare(model, tokenizer)
# Create a text generation pipeline
generator = pipeline('text-generation', model=model, tokenizer=tokenizer)
# Function to ask a medical question
def ask_question(question_type, question):
prompt = f"""Below is a Question Type that describes the type of question, paired with a question that asks a question based on medical science. Give an answer that correctly answers the question.
### Question Type:
{question_type}
### Question:
{question}
### Answer:
"""
# Adjust max_length and specify eos_token_id for better stopping
eos_token_id = tokenizer.eos_token_id
response = generator(prompt, max_length=1024, eos_token_id=eos_token_id, num_return_sequences=1)
answer = response[0]['generated_text'][len(prompt):]
return answer.strip()
# Example usage
question_type = "prevention"
question = "How can I protect myself from poisoning caused by marine toxins?"
print(ask_question(question_type, question))
- Downloads last month
- 3
8-bit
Model tree for ujjman/llama-3.2-3B-Medical-QnA-unsloth
Base model
meta-llama/Llama-3.2-3B