-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e49c54
commit e0ff05d
Showing
22 changed files
with
122 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,52 @@ | ||
# rlhf-in-2024-with-dpo-and-hf | ||
# RLHF with Dagster and Modal! | ||
|
||
## Why | ||
|
||
Re-usable & scalable RLHF training pipeline with Dagster and Modal. | ||
|
||
![endstate](./docs/12.png) | ||
|
||
Read full story in this blog post: [RLHF with Dagster and Modal](https://kyrylai.com/2024/06/10/rlhf-with-dagster-and-modal/) | ||
|
||
## Access | ||
|
||
You would need access to | ||
|
||
- [HF](https://huggingface.co/docs/huggingface_hub/quick-start) to save your model. | ||
- [Modal](https://modal.com/docs/guide#getting-started) to use GPU for training. | ||
- [OpenAI](https://openai.com/index/openai-api/) to use GPT-4 for evaluation. | ||
|
||
Make sure your .env file looks like this: | ||
|
||
``` | ||
HF_TOKEN=hf_ | ||
MODAL_TOKEN_ID=ak- | ||
MODAL_TOKEN_SECRET=as- | ||
OPENAI_API_KEY=sk | ||
``` | ||
|
||
|
||
## Setup | ||
|
||
The recommended way is to use a prebuilt [Docker image](https://github.com/kyryl-opens-ml/rlfh-dagster-modal/pkgs/container/rlfh-dagster-modal). | ||
``` | ||
docker pull ghcr.io/kyryl-opens-ml/rlfh-dagster-modal:main | ||
docker run -it --env-file .env -p 3000:3000 ghcr.io/kyryl-opens-ml/rlfh-dagster-modal:main | ||
``` | ||
|
||
|
||
## Deploy Modal functions | ||
|
||
Make sure you depliyed training & inference function to [Modal](https://modal.com/). | ||
|
||
``` | ||
modal deploy ./rlhf_training/serverless_functions.py | ||
``` | ||
|
||
## Run Dagster end2end | ||
|
||
Finally run Dagster. | ||
|
||
``` | ||
modal deploy ./rlhf_training/smodal_functions.py | ||
dagster dev -f rlhf_training/__init__.py -p 3000 -h 0.0.0.0 | ||
``` |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters