Spaces:
Running
Running
Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +4 -9
Dockerfile
CHANGED
|
@@ -13,19 +13,14 @@ WORKDIR /code
|
|
| 13 |
COPY requirements.txt /code/requirements.txt
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
from huggingface_hub import snapshot_download
|
| 20 |
-
MODEL_CACHE_DIR = '/code/models'
|
| 21 |
-
snapshot_download(repo_id='FunAudioLLM/SenseVoiceSmall', local_dir=os.path.join(MODEL_CACHE_DIR, 'SenseVoiceSmall'), ignore_patterns=['*.onnx'])
|
| 22 |
-
snapshot_download(repo_id='funasr/fsmn-vad', local_dir=os.path.join(MODEL_CACHE_DIR, 'fsmn-vad'), ignore_patterns=['*.onnx'])
|
| 23 |
-
"
|
| 24 |
|
| 25 |
# Copy application source
|
| 26 |
COPY . /code
|
| 27 |
|
| 28 |
-
# Change permissions
|
| 29 |
RUN chmod -R 777 /code
|
| 30 |
|
| 31 |
# Expose default port
|
|
|
|
| 13 |
COPY requirements.txt /code/requirements.txt
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
+
# Copy download script and pre-cache models inside image
|
| 17 |
+
COPY download_models.py /code/download_models.py
|
| 18 |
+
RUN python3 /code/download_models.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
# Copy application source
|
| 21 |
COPY . /code
|
| 22 |
|
| 23 |
+
# Change permissions to run under non-root user in HF Spaces
|
| 24 |
RUN chmod -R 777 /code
|
| 25 |
|
| 26 |
# Expose default port
|