Skip to content

Commit

Permalink
adding missing get started hint about env file
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterXY89 committed Jan 14, 2024
1 parent 0dcc6b1 commit d5c1996
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ __pycache__/
.vscode/

node_modules/
*-lock.json
*-lock.json

chat_doc/data/
__data/

.$*
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pipe = pipeline("text-generation", model="MisterXY89/chat-doctor")
pipe("Hi, I feel dizzy and have a headache for a few days already. Should I go the doctor?")
```

### Reproduce the Results
### Reproduce the Results and run the CLI
To use the ChatDoc application, follow the steps below:
1. Clone the Repository:
```bash
Expand All @@ -53,28 +53,41 @@ conda env create -f environment.yml
conda activate chat-doc
```

3. Set up pre-commit hooks:
3. (Set up pre-commit hooks:)
```bash
pre-commit install
```

4. Generate Data:
1. Rename the `.env.example` file to `.env` and fill in your credentials.
```bash
# assuming you are in the root folder of the project
mv chat_doc/.env.example chat_doc/.env
nano chat_doc/.env
```

1. Generate Data:
To generate data for the chatbot, use the following command:
```bash
python pipe.py generate --dataset dialogue-full
```
Replace dataset name with one of: `"pmc", "icd", "diagnose", "med-dialogue", "dialogue-full", "full"`.

5. Train the Model:
1. Train the Model:
Training is done on AWS SageMaker, you can use the CLI to start the training:
```bash
python pipe.py train --dataset xxx --model xxx
```

Replace dataset name with one of: `"pmc", "icd", "diagnose", "med-dialogue", "dialogue-full", "full"`,
model can be any llama2 model from the [huggingface model hub](https://huggingface.co/meta-llama).

Alternativly, you can use the `sage_maker_training.ipynb` notebook and configure the training job there.

6. Start the Web-App:
```bash
python pipe.py run-app
```

## Training Results
The first training results are stored in the [logs](./logs) folder and visualized below:
![Training results 13B](/images/results-7B-08-12-23.png)
Expand Down
12 changes: 11 additions & 1 deletion chat_doc/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
HF_TOKEN="TOKEN"
# change every XXXXX to your own value
HF_TOKEN='XXXXX'
HF_USERNAME='XXXXX'

SECRET_KEY='XXXXX'
WTF_CSRF_SECRET_KEY='XXXXX'

# you can change the name if you want
FLASK_APP_NAME='Chat-Doctor'
# this should be the same as the name in docker-compose.yml
FLASK_APP_DB_NAME='app.db'

0 comments on commit d5c1996

Please sign in to comment.