File size: 943 Bytes
0a349f8
 
 
 
 
2681f9e
0a349f8
2681f9e
0a349f8
2681f9e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM huggingface/transformers-pytorch-gpu

RUN python3 -c "from transformers import Automodel; Automodel.from_pretrained('bert-base-uncased')"
RUN python3 -c "from transformers import AutoTokenizer; AutoTokenizer.from_pretrained('bert-base-uncased')"

#RUN pip install fastapi uvicorn

#EXPOSE 7860

#ENTRYPOINT [ "transformers-cli", "serve", "--port=7860", "--host=0.0.0.0", "--task=fill-mask", "--model=bert-base-uncased"]




FROM python:3.10-slim

WORKDIR /code

COPY requirements.txt ./

#RUN pip3 install "git+https://github.com/openai/whisper.git" 
#RUN apt-get update && apt-get install -y ffmpeg

RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

RUN useradd -m -u 1000 user

USER user

ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

COPY --chown=user . $HOME/app/

CMD ["transformers-cli", "serve", "--host", "0.0.0.0", "--port", "7860", "--task=fill-mask", "--model=bert-base-uncased"]