Grinding commited on
Commit
a35dba6
·
verified ·
1 Parent(s): c61a2a3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -4
Dockerfile CHANGED
@@ -15,12 +15,14 @@ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
15
  ENV HF_HOME=/data/hf_cache
16
  RUN mkdir -p /data/hf_cache && chmod -R 777 /data/hf_cache
17
 
18
- # Pre-download and convert the ASR model with detailed logging
19
- RUN python -c "import logging; logging.basicConfig(level=logging.INFO); \
20
  from faster_whisper import download_model; \
21
  try: download_model('distil-whisper/distil-large-v3', output_dir='/data/hf_cache'); \
22
- except Exception as e: logging.error(f'Model download failed: {e}'); exit(1)" \
23
- && find /data/hf_cache -type f -ls || echo "Cache directory listing failed"
 
 
24
 
25
  # Copy application code
26
  COPY ./app.py /app/app.py
 
15
  ENV HF_HOME=/data/hf_cache
16
  RUN mkdir -p /data/hf_cache && chmod -R 777 /data/hf_cache
17
 
18
+ # Create a script to download the model with logging
19
+ RUN echo "import logging; logging.basicConfig(level=logging.INFO); \
20
  from faster_whisper import download_model; \
21
  try: download_model('distil-whisper/distil-large-v3', output_dir='/data/hf_cache'); \
22
+ except Exception as e: logging.error(f'Model download failed: {e}'); exit(1)" > /app/download_model.py
23
+
24
+ # Run the download script and verify cache
25
+ RUN python /app/download_model.py && find /data/hf_cache -type f -ls || echo "Cache directory listing failed"
26
 
27
  # Copy application code
28
  COPY ./app.py /app/app.py