Spaces:
Sleeping
Sleeping
AKIRA
commited on
Commit
·
bf317f7
1
Parent(s):
21dc720
Feat: Pre-download models in Dockerfile to resolve PermissionError
Browse files- Dockerfile +11 -0
Dockerfile
CHANGED
@@ -7,6 +7,17 @@ ENV HF_HOME=/tmp/.cache
|
|
7 |
COPY requirements.txt .
|
8 |
RUN pip install --no-cache-dir -r requirements.txt
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
COPY . .
|
11 |
|
12 |
EXPOSE 7860
|
|
|
7 |
COPY requirements.txt .
|
8 |
RUN pip install --no-cache-dir -r requirements.txt
|
9 |
|
10 |
+
# Pre-download ASR model
|
11 |
+
RUN python -c "from transformers import AutoProcessor; from optimum.onnxruntime import ORTModelForSpeechSeq2Seq; AutoProcessor.from_pretrained('openai/whisper-base'); ORTModelForSpeechSeq2Seq.from_pretrained('openai/whisper-base', provider='CPUExecutionProvider')"
|
12 |
+
|
13 |
+
# Pre-download Translation models
|
14 |
+
RUN python -c "from transformers import pipeline; pipeline('translation', model='Helsinki-NLP/opus-mt-en-zh')"
|
15 |
+
RUN python -c "from transformers import pipeline; pipeline('translation', model='Helsinki-NLP/opus-mt-zh-en')"
|
16 |
+
RUN python -c "from transformers import pipeline; pipeline('translation', model='staka/fugumt-en-ja')"
|
17 |
+
RUN python -c "from transformers import pipeline; pipeline('translation', model='Helsinki-NLP/opus-mt-ja-en')"
|
18 |
+
RUN python -c "from transformers import pipeline; pipeline('translation', model='Helsinki-NLP/opus-mt-tc-big-en-ko')"
|
19 |
+
RUN python -c "from transformers import pipeline; pipeline('translation', model='Helsinki-NLP/opus-mt-ko-en')"
|
20 |
+
|
21 |
COPY . .
|
22 |
|
23 |
EXPOSE 7860
|