Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +30 -3
Dockerfile
CHANGED
@@ -3,8 +3,35 @@ FROM huggingface/transformers-pytorch-gpu
|
|
3 |
RUN python3 -c "from transformers import Automodel; Automodel.from_pretrained('bert-base-uncased')"
|
4 |
RUN python3 -c "from transformers import AutoTokenizer; AutoTokenizer.from_pretrained('bert-base-uncased')"
|
5 |
|
6 |
-
RUN pip install fastapi uvicorn
|
7 |
|
8 |
-
EXPOSE 7860
|
9 |
|
10 |
-
ENTRYPOINT [ "transformers-cli", "serve", "--port=7860", "--host=0.0.0.0", "--task=fill-mask", "--model=bert-base-uncased"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
RUN python3 -c "from transformers import Automodel; Automodel.from_pretrained('bert-base-uncased')"
|
4 |
RUN python3 -c "from transformers import AutoTokenizer; AutoTokenizer.from_pretrained('bert-base-uncased')"
|
5 |
|
6 |
+
#RUN pip install fastapi uvicorn
|
7 |
|
8 |
+
#EXPOSE 7860
|
9 |
|
10 |
+
#ENTRYPOINT [ "transformers-cli", "serve", "--port=7860", "--host=0.0.0.0", "--task=fill-mask", "--model=bert-base-uncased"]
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
FROM python:3.10-slim
|
16 |
+
|
17 |
+
WORKDIR /code
|
18 |
+
|
19 |
+
COPY requirements.txt ./
|
20 |
+
|
21 |
+
#RUN pip3 install "git+https://github.com/openai/whisper.git"
|
22 |
+
#RUN apt-get update && apt-get install -y ffmpeg
|
23 |
+
|
24 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
25 |
+
|
26 |
+
RUN useradd -m -u 1000 user
|
27 |
+
|
28 |
+
USER user
|
29 |
+
|
30 |
+
ENV HOME=/home/user \
|
31 |
+
PATH=/home/user/.local/bin:$PATH
|
32 |
+
|
33 |
+
WORKDIR $HOME/app
|
34 |
+
|
35 |
+
COPY --chown=user . $HOME/app/
|
36 |
+
|
37 |
+
CMD ["transformers-cli", "serve", "--host", "0.0.0.0", "--port", "7860", "--task=fill-mask", "--model=bert-base-uncased"]
|