Spaces:
Sleeping
Sleeping
out of memory fix
Browse files- Dockerfile +4 -6
Dockerfile
CHANGED
|
@@ -33,17 +33,15 @@ ENV HF_HOME=/models/huggingface \
|
|
| 33 |
# Created cache dir and set permissions
|
| 34 |
RUN mkdir -p /models/huggingface && chmod -R 777 /models/huggingface
|
| 35 |
|
| 36 |
-
# Pre-download models at build time
|
| 37 |
-
RUN python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='facebook/mms-
|
| 38 |
-
&& python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='facebook/mms-tts-hau')" \
|
| 39 |
&& python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='facebook/mms-tts-eng')" \
|
| 40 |
&& python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='facebook/mms-tts-yor')" \
|
| 41 |
&& python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='NCAIR1/Igbo-ASR')" \
|
| 42 |
&& find /models/huggingface -name '*.lock' -delete
|
| 43 |
|
| 44 |
-
# Preload tokenizers (avoid runtime delays)
|
| 45 |
-
RUN python -c "from transformers import
|
| 46 |
-
&& python -c "from transformers import WhisperProcessor; WhisperProcessor.from_pretrained('NCAIR1/Igbo-ASR')" \
|
| 47 |
&& python -c "from transformers import pipeline; pipeline('text-to-speech', model='facebook/mms-tts-hau')" \
|
| 48 |
&& python -c "from transformers import pipeline; pipeline('text-to-speech', model='facebook/mms-tts-eng')" \
|
| 49 |
&& python -c "from transformers import pipeline; pipeline('text-to-speech', model='facebook/mms-tts-yor')"
|
|
|
|
| 33 |
# Created cache dir and set permissions
|
| 34 |
RUN mkdir -p /models/huggingface && chmod -R 777 /models/huggingface
|
| 35 |
|
| 36 |
+
# Pre-download models at build time (split into smaller chunks to avoid memory issues)
|
| 37 |
+
RUN python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='facebook/mms-tts-hau')" \
|
|
|
|
| 38 |
&& python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='facebook/mms-tts-eng')" \
|
| 39 |
&& python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='facebook/mms-tts-yor')" \
|
| 40 |
&& python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='NCAIR1/Igbo-ASR')" \
|
| 41 |
&& find /models/huggingface -name '*.lock' -delete
|
| 42 |
|
| 43 |
+
# Preload tokenizers (avoid runtime delays) - MMS will be lazy-loaded
|
| 44 |
+
RUN python -c "from transformers import WhisperProcessor; WhisperProcessor.from_pretrained('NCAIR1/Igbo-ASR')" \
|
|
|
|
| 45 |
&& python -c "from transformers import pipeline; pipeline('text-to-speech', model='facebook/mms-tts-hau')" \
|
| 46 |
&& python -c "from transformers import pipeline; pipeline('text-to-speech', model='facebook/mms-tts-eng')" \
|
| 47 |
&& python -c "from transformers import pipeline; pipeline('text-to-speech', model='facebook/mms-tts-yor')"
|