leesenx commited on
Commit
509b5d2
·
verified ·
1 Parent(s): 5aa3f44

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -13
Dockerfile CHANGED
@@ -1,26 +1,23 @@
1
  FROM python:3.12-slim
2
-
3
- RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/*
4
-
5
  WORKDIR /app
6
-
 
 
 
7
  RUN pip install --no-cache-dir \
8
  onnxruntime==1.21.0 \
9
- torch==2.12.0+cpu \
10
- torchaudio==2.11.0+cpu \
11
  torchcodec \
12
  sentencepiece \
13
  numpy \
14
  soundfile \
15
  gradio \
16
- huggingface_hub \
17
- -f https://download.pytorch.org/whl/cpu
18
-
19
  COPY app.py .
20
- RUN python -c "from huggingface_hub import snapshot_download; \
21
- snapshot_download('OpenMOSS-Team/MOSS-TTS-Nano-100M-ONNX', local_dir='models/MOSS-TTS-Nano-100M-ONNX', allow_patterns=['*.onnx','*.data','*.json','tokenizer.model']); \
22
- snapshot_download('OpenMOSS-Team/MOSS-Audio-Tokenizer-Nano-ONNX', local_dir='models/MOSS-Audio-Tokenizer-Nano-ONNX', allow_patterns=['*.onnx','*.data','*.json'])"
23
-
24
  ENV GRADIO_SERVER_NAME=0.0.0.0
25
  ENV GRADIO_SERVER_PORT=7860
26
  EXPOSE 7860
 
1
  FROM python:3.12-slim
2
+ RUN apt-get update && \
3
+ apt-get install -y --no-install-recommends ffmpeg && \
4
+ rm -rf /var/lib/apt/lists/*
5
  WORKDIR /app
6
+ RUN pip install --no-cache-dir \
7
+ --extra-index-url https://download.pytorch.org/whl/cpu \
8
+ torch==2.11.0+cpu \
9
+ torchaudio==2.11.0+cpu
10
  RUN pip install --no-cache-dir \
11
  onnxruntime==1.21.0 \
 
 
12
  torchcodec \
13
  sentencepiece \
14
  numpy \
15
  soundfile \
16
  gradio \
17
+ huggingface_hub
 
 
18
  COPY app.py .
19
+ ENV MOSS_MODEL_DIR=/app/models
20
+ ENV MOSS_OUTPUT_DIR=/tmp/moss_output
 
 
21
  ENV GRADIO_SERVER_NAME=0.0.0.0
22
  ENV GRADIO_SERVER_PORT=7860
23
  EXPOSE 7860