Spaces:
Runtime error
Runtime error
scontess
commited on
Commit
Β·
700597c
1
Parent(s):
2c687b3
pippo
Browse files- Dockerfile +1 -5
- src/streamlit_app.py +8 -2
Dockerfile
CHANGED
@@ -16,11 +16,7 @@ RUN pip3 install -r requirements.txt
|
|
16 |
|
17 |
RUN chmod -R 755 /app
|
18 |
|
19 |
-
RUN mkdir -p /app/.cache && chmod -R
|
20 |
-
|
21 |
-
RUN mkdir -p /app/src/downloads && chmod -R 755 /app/src
|
22 |
-
RUN mkdir -p /app/src/downloads/extracted && chmod -R 755 /app/src
|
23 |
-
RUN mkdir -p /app/src/imagenet_resized && chmod -R 755 /app/src
|
24 |
|
25 |
|
26 |
EXPOSE 8501
|
|
|
16 |
|
17 |
RUN chmod -R 755 /app
|
18 |
|
19 |
+
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
|
|
|
|
|
|
|
|
|
20 |
|
21 |
|
22 |
EXPOSE 8501
|
src/streamlit_app.py
CHANGED
@@ -14,8 +14,8 @@ import seaborn as sns
|
|
14 |
from huggingface_hub import HfApi
|
15 |
import os
|
16 |
|
17 |
-
# π Percorso della cartella dove sarΓ salvato il dataset
|
18 |
-
DATA_DIR = "/app" #"/tmp"
|
19 |
|
20 |
|
21 |
# π Autenticazione Hugging Face dal Secret nello Space
|
@@ -38,6 +38,12 @@ else:
|
|
38 |
# π Carica solo 300 immagini da `imagenet_resized/64x64`
|
39 |
st.write("π Caricamento di 300 immagini da `imagenet_resized/64x64`...")
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
# π Carica il dataset direttamente da Hugging Face
|
42 |
dataset = load_dataset("sradc/imagenet_resized_64x64", split="train")
|
43 |
|
|
|
14 |
from huggingface_hub import HfApi
|
15 |
import os
|
16 |
|
17 |
+
# π Percorso della cartella dove sarΓ salvato il dataset se uso TFlow, non serve se setto hf_dataset_cache
|
18 |
+
#DATA_DIR = "/app" #"/tmp"
|
19 |
|
20 |
|
21 |
# π Autenticazione Hugging Face dal Secret nello Space
|
|
|
38 |
# π Carica solo 300 immagini da `imagenet_resized/64x64`
|
39 |
st.write("π Caricamento di 300 immagini da `imagenet_resized/64x64`...")
|
40 |
|
41 |
+
# π Recupera il valore della variabile d'ambiente
|
42 |
+
hf_cache_path = os.getenv("HF_DATASETS_CACHE", "β Variabile non impostata!")
|
43 |
+
|
44 |
+
# πΉ Mostra il valore nella UI di Streamlit
|
45 |
+
st.write(f"π Cache dei dataset Hugging Face: {hf_cache_path}")
|
46 |
+
|
47 |
# π Carica il dataset direttamente da Hugging Face
|
48 |
dataset = load_dataset("sradc/imagenet_resized_64x64", split="train")
|
49 |
|