nexusbert commited on
Commit
986c194
·
1 Parent(s): 4b62031

out of memory fix

Browse files
Files changed (1) hide show
  1. 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-1b-all')" \
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 Wav2Vec2Processor; Wav2Vec2Processor.from_pretrained('facebook/mms-1b-all')" \
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')"