a.pourmand commited on
Commit
d15224c
·
1 Parent(s): 7d3ec78
Files changed (4) hide show
  1. .dockerignore +1 -0
  2. Dockerfile +25 -0
  3. docker-compose.yaml +22 -0
  4. requirements.txt +5 -3
.dockerignore ADDED
@@ -0,0 +1 @@
 
 
1
+ Cache/
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ RUN useradd -m -u 1000 user
4
+ USER user
5
+ ENV HOME=/home/user \
6
+ PATH=/home/user/.local/bin:${PATH}
7
+ WORKDIR ${HOME}/app
8
+
9
+ COPY --chown=1000 requirements.txt /tmp/requirements.txt
10
+
11
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt
12
+
13
+ COPY --chown=1000 . ${HOME}/app
14
+
15
+ ENV PYTHONPATH=${HOME}/app \
16
+ PYTHONUNBUFFERED=1 \
17
+ GRADIO_ALLOW_FLAGGING=never \
18
+ GRADIO_NUM_PORTS=1 \
19
+ GRADIO_SERVER_NAME=0.0.0.0 \
20
+ GRADIO_THEME=huggingface \
21
+ SYSTEM=spaces \
22
+ GRADIO_SERVER_PORT=9000
23
+ EXPOSE 9000
24
+
25
+ CMD ["python","app.py"]
docker-compose.yaml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3.7"
2
+
3
+ services:
4
+ whisper_large_v2_service:
5
+ image: whisper_large_v2:v0.1
6
+ environment:
7
+ - GIT_PYTHON_REFRESH=quiet
8
+ - HUGGINGFACE_HUB_CACHE=/home/user/temp/.cache
9
+ - TRANSFORMERS_CACHE=/home/user/temp/.cache
10
+ - HF_HOME=/home/user/temp/.cache
11
+ - TORCH_HOME=/home/user/temp/torch
12
+ - TRANSFORMERS_OFFLINE=1
13
+ tty: true
14
+ stdin_open: true
15
+ volumes:
16
+ - Cache/:/home/user/temp/torch
17
+ - Cache/:/home/user/temp/.cache
18
+ build:
19
+ context: .
20
+ container_name: whisper_large_v2
21
+ ports:
22
+ - 8007:9000
requirements.txt CHANGED
@@ -1,3 +1,5 @@
1
- git+https://github.com/huggingface/transformers
2
- torch
3
- yt-dlp
 
 
 
1
+ gradio==3.42.0
2
+ torch==1.13.1
3
+ transformers==4.30.0
4
+ yt_dlp==2023.7.6
5
+ ffmpeg-python