File size: 2,670 Bytes
500065d
 
 
 
 
 
 
 
 
 
 
6b122bc
500065d
6b122bc
 
500065d
6b122bc
500065d
6b122bc
500065d
42d4080
 
 
 
 
 
 
c10b8b4
 
 
 
 
 
 
 
 
42d4080
 
 
 
 
f337535
42d4080
 
 
f337535
42d4080
500065d
4a70d5d
 
 
 
6b122bc
500065d
d6c690b
 
6b122bc
500065d
d6c690b
 
 
 
 
 
 
 
 
 
 
 
 
 
500065d
d6c690b
 
 
 
 
6b122bc
d6c690b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
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.