clov-medchat / README.md
Alan Joshua
Update README.md
f337535 verified
|
Raw
History Blame Contribute Delete
2.67 kB
---
base_model: unsloth/mistral-7b-instruct-v0.2-bnb-4bit
library_name: peft
pipeline_tag: text-generation
tags:
- base_model:adapter:unsloth/mistral-7b-instruct-v0.2-bnb-4bit
- lora
- transformers
- unsloth
---
## Use this model
```python
!pip install -q --upgrade bitsandbytes transformers accelerate
from transformers import pipeline
pipe = pipeline("text-generation", model="alanjoshua2005/alan-mistral-finetuned")
user_input = input("Enter your medical question or prompt: ")
prompt = (
f"""Imagine you are a helpful medical chatbot. Respond based on the user input below:
<s>[INST] {user_input} [/INST]
Please provide your answer in **structured Markdown format**. Follow these rules:
- Complete the answer fully; do not stop mid-sentence
- Use emojis to highlight key points
- Use horizontal lines (---) to separate sections
- Use bullet points and numbered lists where appropriate
- Use tables if necessary to organize information clearly
- Explain medical terms in simple words
- Do NOT include any links, URLs, or image references
- Make the response easy-to-read and informative
"""
)
result = pipe(
prompt,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.1
)
generated_text = result[0]["generated_text"]
response = generated_text.replace(prompt, "").strip()
print(response)
```
---
## Model Details
* **Developed by:** Alan Joshua
* **Model type:** Text-Generation
* **Language(s):** English
* **License:** MIT
* **Finetuned from model:** unsloth/mistral-7b-instruct-v0.2-bnb-4bit
* **Dataset:** ruslanmv/ai-medical-chatbot
---
## Model Description
This model is a **medical chatbot** fine-tuned on the `ruslanmv/ai-medical-chatbot` dataset using LoRA adapters on the Mistral 7B instruct model (4-bit). It is designed to provide **accurate, easy-to-understand medical information** in English.
Key features of this model include:
* **Structured Markdown responses:** Answers are formatted using bullets, numbered lists, tables, and horizontal lines for readability.
* **Clear explanations:** Medical terms are explained in simple words for users of all backgrounds.
* **Emojis:** Used to highlight key points and make responses more engaging.
* **No links or images:** Ensures responses remain text-only for safe, direct answers.
* **Complete answers:** Designed to generate full, coherent responses without cutting off mid-sentence.
This model is suitable for educational purposes, healthcare awareness, and interactive Q&A applications. **It is not a substitute for professional medical advice.** Always verify information with a qualified healthcare provider.