Spaces:
Runtime error
Runtime error
Commit ·
1838da2
1
Parent(s): 451f92d
chache dir
Browse files- Dockerfile +7 -0
- app.py +2 -1
Dockerfile
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
|
|
|
|
|
| 1 |
# Dockerfile
|
| 2 |
FROM python:3.10-slim
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
# 1) Install HF tooling & runtime deps
|
| 6 |
RUN pip install --no-cache-dir huggingface_hub
|
| 7 |
COPY requirements.txt .
|
|
|
|
| 1 |
+
# redirige tous les caches HF vers /app/model_cache/hf_cache
|
| 2 |
+
|
| 3 |
# Dockerfile
|
| 4 |
FROM python:3.10-slim
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
ENV HF_HOME="/app/model_cache/hf_cache"
|
| 8 |
+
ENV TRANSFORMERS_CACHE="/app/model_cache/transformers_cache"
|
| 9 |
+
ENV HF_HUB_CACHE="/app/model_cache/hf_hub_cache"
|
| 10 |
+
ENV HF_DATASETS_CACHE="/app/model_cache/datasets_cache"
|
| 11 |
+
|
| 12 |
# 1) Install HF tooling & runtime deps
|
| 13 |
RUN pip install --no-cache-dir huggingface_hub
|
| 14 |
COPY requirements.txt .
|
app.py
CHANGED
|
@@ -26,7 +26,8 @@ model_name = "numind/NuExtract-1.5-tiny"
|
|
| 26 |
# MODEL_PATH = "/app/model_cache"
|
| 27 |
model_cache_path = snapshot_download(
|
| 28 |
repo_id="numind/NuExtract-1.5-tiny",
|
| 29 |
-
local_dir="/app/model_cache" # <-- direct destination
|
|
|
|
| 30 |
)
|
| 31 |
|
| 32 |
print(">>> MODEL CACHE PATH:", model_cache_path, os.listdir(model_cache_path))
|
|
|
|
| 26 |
# MODEL_PATH = "/app/model_cache"
|
| 27 |
model_cache_path = snapshot_download(
|
| 28 |
repo_id="numind/NuExtract-1.5-tiny",
|
| 29 |
+
local_dir="/app/model_cache", # <-- direct destination
|
| 30 |
+
cache_dir="/app/model_cache/hf_cache"
|
| 31 |
)
|
| 32 |
|
| 33 |
print(">>> MODEL CACHE PATH:", model_cache_path, os.listdir(model_cache_path))
|