Skip to content
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

Merged
merged 10 commits into from
Sep 13, 2023
Merged

Add the initial docker file #51

merged 10 commits into from
Sep 13, 2023

Conversation

alexchen4ai
Copy link
Contributor

Add the initial docker file. TODO: Remove the OPENAI token, try to make it as environmental variables && add GPU function support.

Copy link
Collaborator

@goldmermaid goldmermaid left a 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.

gradio_test.py Outdated Show resolved Hide resolved
app = pykoi.Application(debug=False, share=False)
app = pykoi.Application(
debug=False,
share=True)
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 23 to 41
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
Copy link
Collaborator

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

Copy link
Contributor Author

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:
Copy link
Collaborator

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.

  1. build the base image using dockerfile docker/pykoi-cpu/Dockerfile into docker image "weialexchen/pykoi-cpu:base"
  2. build the app image using dockerfile docker/pykoi-cpu-custom/Dockerfile into docker image weialexchen/pykoi-cpu:app

nit: change we change weialexchen to pykoi, so we can push them into dockerhub easily later.

Copy link
Contributor Author

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.

Copy link
Collaborator

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

EXPOSE 5000

# For dev
CMD ["python", "app.py"]
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE.

docker/pykoi-cpu/Dockerfile Outdated Show resolved Hide resolved
xformers \
pykoi

CMD ["/bin/bash"]
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE

@garyjyzhang
Copy link
Contributor

LGTM!

1 similar comment
@CambioML
Copy link
Collaborator

LGTM!

@CambioML CambioML merged commit ff3ec5e into CambioML:main Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants