Commit ·
bb1e27f
1
Parent(s): 1d37fc8
Dockerfile: single-line model-download RUNs (ACR dep-scanner compatibility)
Browse filesACR Tasks' Dockerfile dependency scanner fails on backslash line-continuations
inside a quoted python -c string; collapse to single lines. Functionally
identical; normal docker build (HF Spaces) was unaffected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Dockerfile +6 -9
Dockerfile
CHANGED
|
@@ -38,18 +38,15 @@ RUN pip install --no-cache-dir --break-system-packages -r requirements.txt
|
|
| 38 |
# https://github.com/Dao-AILab/flash-attention/releases
|
| 39 |
# e.g. RUN pip install <wheel-url> --no-build-isolation
|
| 40 |
|
| 41 |
-
# Pre-download ASR model into the image (no persistent storage available on HF Spaces)
|
|
|
|
|
|
|
| 42 |
RUN mkdir -p /app/model_cache /app/torch_cache && \
|
| 43 |
-
python -c "\
|
| 44 |
-
|
| 45 |
-
snapshot_download('Qwen/Qwen3-ASR-1.7B', cache_dir='/app/model_cache')" \
|
| 46 |
-
&& echo "ASR model pre-downloaded"
|
| 47 |
|
| 48 |
# Pre-download Silero VAD model
|
| 49 |
-
RUN python -c "
|
| 50 |
-
import torch; \
|
| 51 |
-
torch.hub.load('snakers4/silero-vad', 'silero_vad', trust_repo=True); \
|
| 52 |
-
print('Silero VAD cached')" || echo "VAD pre-download failed, will retry at runtime"
|
| 53 |
|
| 54 |
# Copy application code
|
| 55 |
COPY . /app
|
|
|
|
| 38 |
# https://github.com/Dao-AILab/flash-attention/releases
|
| 39 |
# e.g. RUN pip install <wheel-url> --no-build-isolation
|
| 40 |
|
| 41 |
+
# Pre-download ASR model into the image (no persistent storage available on HF Spaces).
|
| 42 |
+
# NOTE: single-line python -c on purpose — ACR's Dockerfile dependency scanner
|
| 43 |
+
# chokes on backslash line-continuations inside a quoted python string.
|
| 44 |
RUN mkdir -p /app/model_cache /app/torch_cache && \
|
| 45 |
+
python -c "from huggingface_hub import snapshot_download; snapshot_download('Qwen/Qwen3-ASR-1.7B', cache_dir='/app/model_cache')" && \
|
| 46 |
+
echo "ASR model pre-downloaded"
|
|
|
|
|
|
|
| 47 |
|
| 48 |
# Pre-download Silero VAD model
|
| 49 |
+
RUN python -c "import torch; torch.hub.load('snakers4/silero-vad', 'silero_vad', trust_repo=True); print('Silero VAD cached')" || echo "VAD pre-download failed, will retry at runtime"
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
# Copy application code
|
| 52 |
COPY . /app
|