Downloads · 30 days
0
MassMin/llama2_ai_medical_chatbot
llama2_ai_medical_chatbot is a machine learning model from MassMin. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is a fine-tuned version of NousResearch/Llama-2-7b-chat-hf on the AI Medical Chatbot dataset, which consists of medical question-answering tasks. It leverages the latest in language model technology for gen…
Downloads · 30 days
0
Access
Public
Updated Sep 7, 2024
Repo size
135 MB
Likes
2
Public
Click a slice to open those files.
.safetensors134 MB · 98%
From the Hugging Face model README
This model is a fine-tuned version of NousResearch/Llama-2-7b-chat-hf on the AI Medical Chatbot dataset, which consists of medical question-answering tasks. It leverages the latest in language model technology for generating accurate and respectful medical assistance responses, providing helpful advice on common medical questions.
Fine-tuned using LoRA (Low-Rank Adaptation) and quantization techniques, this model is optimized for efficiency while maintaining high-quality, contextually relevant outputs. The training was performed using PEFT to make the model more lightweight and accessible for a broader range of applications.
This model was fine-tuned to assist users in answering medical questions, particularly common healthcare concerns such as symptoms, treatments, and remedies. It is not intended to replace professional medical consultation but can be used to offer informative, general responses that can help guide users toward appropriate care.
User: "What are the common treatments for a sore throat?"
Model: "For a sore throat, common treatments include rest, hydration, throat lozenges, warm saltwater gargles, and over-the-counter pain relief medications. If the sore throat persists, you should consult a doctor as it may indicate a bacterial infection."
User: "Can you suggest a homeopathic remedy for hair loss?"
Model: "Homeopathic remedies like Arnica, Phosphorus, and Silicea are often recommended for hair loss. However, it's important to consult a homeopathic practitioner for a tailored treatment."
The model was trained using the following setup:
This model is designed to assist with medical-related queries and provide useful responses. However, users are strongly encouraged to consult licensed healthcare providers for serious medical conditions, diagnoses, or treatment plans. Misuse of the model for self-diagnosis or treatment is discouraged.
The outputs of this model should not be relied upon for critical or life-threatening situations. It is essential to consult a healthcare professional before taking any medical action based on this model's suggestions.
You can load and use this model for medical chatbot applications with ease using the Hugging Face library:
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_id = "NousResearch/Llama-2-7b-chat-hf"
config = PeftConfig.from_pretrained( 'MassMin/llama2_ai_medical_chatbot')
model = AutoModelForCausalLM.from_pretrained(model_id)
model = PeftModel.from_pretrained(model, 'MassMin/llama2_ai_medical_chatbot')
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
tokenizer.pad_token = tokenizer.eos_token
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
max_length=256
)
prompt='Input your question?.'
result = pipe(f"<s>[INST] {prompt} [/INST]")
print(result[0]['generated_text'])