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

dockerfile #113

Open
sdelahaies opened this issue Jun 27, 2023 · 1 comment
Open

dockerfile #113

sdelahaies opened this issue Jun 27, 2023 · 1 comment

Comments

@sdelahaies
Copy link

Many thanks for this great work!

I couldn't find a way to install the requirements properly without complaint so I ended up using the following Dockerfile to run the notebook

FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
# https://dockr.ly/3e57aTq

# fix (tzdata)
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get -y update && \
    apt-get -y upgrade && \
    apt-get install -y python3-pip python3-dev

RUN apt-get install -y locales git vim nano

# requirements
COPY requirements.txt requirements.txt
RUN python3 -m pip install --upgrade pip && \
     python3 -m pip install -r requirements.txt

# Jupyter lab
RUN python3 -m pip install jupyterlab

RUN python3 -m pip install --upgrade --quiet jupyter_client ipywidgets

# run
CMD /bin/bash -c 'jupyter lab --no-browser --allow-root --ip=0.0.0.0 --NotebookApp.token="" --NotebookApp.password=""'

with the following requirements.txt file

--find-links https://download.pytorch.org/whl/torch_stable.html

pandas==1.3.5
torch==1.11.0+cu113
#torch==1.13.0+cu116
#torchdata==0.3.0
torchdata==0.3.0
torchtext==0.12
#torchtext==0.15.1
spacy==3.2.6
altair==4.2.2
jsonschema==4.3.3
jupytext==1.13
flake8
black
GPUtil
wandb
typing_extensions==4.4.0

run the following command to build the image

docker build -t transformers .

then cd to the repo folder and run the container with the command

docker run -it --gpus all -p 8888:8888 -v $PWD:/lab/ transformers

jupyterlab is available at localhost:8888 and the repo can be accessed within the container in the /lab folder.

NOTE: in the notebook for the spacy downloads replace any python with python3

@rayzhou2017
Copy link

Thanks, it helps.

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

No branches or pull requests

2 participants