-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the initial docker file #51
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comment.
example/chatbot/openai_model_demo.py
Outdated
app = pykoi.Application(debug=False, share=False) | ||
app = pykoi.Application( | ||
debug=False, | ||
share=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we can revert all these changes and leave boilerplate code as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docker/pykoi-gpu/Dockerfile
Outdated
python3 -m pip install --no-cache-dir \ | ||
torch \ | ||
torchvision \ | ||
torchaudio && \ | ||
python3 -m pip install --no-cache-dir \ | ||
accelerate \ | ||
datasets \ | ||
hf-doc-builder \ | ||
huggingface-hub \ | ||
Jinja2 \ | ||
librosa \ | ||
numpy \ | ||
scipy \ | ||
tensorboard \ | ||
transformers \ | ||
omegaconf \ | ||
pytorch-lightning \ | ||
xformers \ | ||
pykoi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the gpu version: I think we only need to install?
pip3 install pykoi && pip3 install torch --index-url https://download.pytorch.org/whl/cu118
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but for using huggingface model, more packages/library is needed. I will only keep the torch one.
1. `pykoi-cpu`: The base image for the cpu-based usage. | ||
2. `pykoi-cpu-custom`: When you run this docker image, try to modify the `app.py` and mount it when running the docker container. | ||
|
||
To run a docker container, we can use the following command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: considering that we have not push the docker images into the docker hub, we can add below steps regarding how your build docker images.
- build the base image using dockerfile
docker/pykoi-cpu/Dockerfile
into docker image"weialexchen/pykoi-cpu:base"
- build the app image using dockerfile
docker/pykoi-cpu-custom/Dockerfile
into docker imageweialexchen/pykoi-cpu:app
nit: change we change weialexchen
to pykoi
, so we can push them into dockerhub easily later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, please create a pykoi docker account then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dm you with the dockerhub account and access token for dockerhub push
docker/pykoi-cpu-custom/Dockerfile
Outdated
EXPOSE 5000 | ||
|
||
# For dev | ||
CMD ["python", "app.py"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add an empty line at the end of dockerfile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DONE.
docker/pykoi-gpu/Dockerfile
Outdated
xformers \ | ||
pykoi | ||
|
||
CMD ["/bin/bash"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add an empty line at the end of dockerfile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DONE
LGTM! |
1 similar comment
LGTM! |
Add the initial docker file. TODO: Remove the OPENAI token, try to make it as environmental variables && add GPU function support.