Instructions to use hazemgalal1/gptneo125m-medical-qa-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use hazemgalal1/gptneo125m-medical-qa-merged with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
base_model: EleutherAI/gpt-neo-125M
|
| 5 |
+
tags:
|
| 6 |
+
- text-generation
|
| 7 |
+
- medical
|
| 8 |
+
- question-answering
|
| 9 |
+
- lora
|
| 10 |
+
- peft
|
| 11 |
+
- gpt-neo
|
| 12 |
+
datasets:
|
| 13 |
+
- medalpaca/medical_meadow_medqa
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# 🏥 GPT-Neo 125M — Medical QA LoRA Fine-tune
|
| 17 |
+
|
| 18 |
+
## Model Description
|
| 19 |
+
موديل GPT-Neo 125M تم عمله Fine-tuning على داتا أسئلة وأجوبة طبية (USMLE style) باستخدام LoRA.
|
| 20 |
+
|
| 21 |
+
- **Developed by:** Hazem Galal
|
| 22 |
+
- **Supervised by:** Eng. Mahmoud Khorshed
|
| 23 |
+
- **License:** MIT
|
| 24 |
+
- **Base Model:** EleutherAI/gpt-neo-125M
|
| 25 |
+
|
| 26 |
+
## المواصفات
|
| 27 |
+
|
| 28 |
+
| المواصفة | القيمة |
|
| 29 |
+
|-----------|--------|
|
| 30 |
+
| Base Model | EleutherAI/gpt-neo-125M |
|
| 31 |
+
| Dataset | medalpaca/medical_meadow_medqa |
|
| 32 |
+
| LoRA Rank (r) | 8 |
|
| 33 |
+
| LoRA Alpha | 16 |
|
| 34 |
+
| Block Size | 256 |
|
| 35 |
+
| Epochs | 3 |
|
| 36 |
+
| Learning Rate | 2e-4 |
|
| 37 |
+
|
| 38 |
+
## طريقة الاستخدام
|
| 39 |
+
|
| 40 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 41 |
+
|
| 42 |
+
model = AutoModelForCausalLM.from_pretrained("hazemgalal1/gptneo125m-medical-qa-merged")
|
| 43 |
+
tokenizer = AutoTokenizer.from_pretrained("hazemgalal1/gptneo125m-medical-qa-merged")
|
| 44 |
+
|
| 45 |
+
prompt = (
|
| 46 |
+
"### Instruction:\nAnswer the following medical question.\n\n"
|
| 47 |
+
"### Question:\nWhat is the first-line treatment for hypertension?\n\n"
|
| 48 |
+
"### Answer:\n"
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 52 |
+
outputs = model.generate(**inputs, max_new_tokens=100, do_sample=True, temperature=0.7)
|
| 53 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 54 |
+
|
| 55 |
+
## تنبيه
|
| 56 |
+
هذا الموديل للأغراض التعليمية فقط، وليس بديلاً عن الاستشارة الطبية المتخصصة.
|