📝 Paper • 🤗 Hugging Face • 🧩 Github
- [6/21/2024] We have upgraded a web-based interface for users to use.
- [2/18/2024] The first version of the model was released.
EyeDoc is the first open-source large language model focused on ophthalmic diseases. Our goal in developing EyeDoc is to create a more specialized large language model for the specific medical consultation scenario of ophthalmic diseases. Overall, compared to other medical large language models, our contributions are as follows:
-
We have collected over 40,000 single-turn QA dialogues and nearly 9,000 multi-turn dialogues related to ophthalmic diseases. To standardize the multi-turn dialogue data, we used gpt-3.5-turbo for data cleaning.
-
We have gathered knowledge information on 519 common ophthalmic diseases and constructed a specialized knowledge base for auxiliary diagnosis of ophthalmic diseases.
-
We have fully considered the knowledge differences and language characteristics of doctors and patients during consultations, and based on this, we separately represented the features for doctors and patients.
Use conda to create a new virtual environment with Python 3.9.0. Run the following command:
git clone https://github.com/sperfu/EyeDoc
conda create --name EyeDoc python=3.9.0
conda activate EyeDoc
pip install -r requirements.txt
<!-- ```
python==3.9.0
torch==2.1.2
transformers==4.35.2
peft==0.7.1
accelerate==0.25.0
bitsandbytes==0.42.0
rouge_chinese
nltk
``` -->
## 💭 Preparation
EyeDoc is fine-tuned based on a large language model. Before training, please configure or download the base large language model.
| Parameter Scale | Large Language Model Name |
| ----------------| --------------------------------------------------------------|
| 1B | [TinyLlama](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0) |
| 3B | [bloom-zh-3b-chat](https://huggingface.co/ikala/bloom-zh-3b-chat) |
| 7B | [Llama-2-7b-chat-hf](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf) |
## ⚒️ Training
### 1. QA Training
```python
python A_train.py
# For more model hyperparameter adjustments, see the main function
python A_train_doc_specific.py
# For more model hyperparameter adjustments, see the main function
python A_evaluate.py
# For more model hyperparameter adjustments, see the main function
python A_generate.py # # Model response generation
python A_Flask_web.py # Model API interface call
To deploy the EyeDoc model using Streamlit, follow these steps:
First, ensure you have Python installed (preferably Python 3.9). Then, install Streamlit and other necessary packages:
pip install streamlit
pip install -r requirements.txt # Ensure all dependencies listed in the requirements file are installed
Run the Streamlit application using the following command:
streamlit run st_chat_login.py
This will start the Streamlit service, and you can access the web interface through the provided local URL (e.g., http://localhost:8501).