Spaces:
Runtime error
Runtime error
scontess
commited on
Commit
Β·
3472a3b
1
Parent(s):
700597c
pippo
Browse files- src/streamlit_app.py +9 -0
src/streamlit_app.py
CHANGED
@@ -44,6 +44,15 @@ hf_cache_path = os.getenv("HF_DATASETS_CACHE", "β Variabile non impostata!")
|
|
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 |
|
|
|
44 |
# πΉ Mostra il valore nella UI di Streamlit
|
45 |
st.write(f"π Cache dei dataset Hugging Face: {hf_cache_path}")
|
46 |
|
47 |
+
# π Testa se la cache ha i permessi giusti PRIMA di caricare il dataset
|
48 |
+
test_file = "/app/.cache/test.txt"
|
49 |
+
try:
|
50 |
+
with open(test_file, "w") as f:
|
51 |
+
f.write("Test permessi OK!")
|
52 |
+
st.write("β
La cartella ha i permessi giusti!")
|
53 |
+
except PermissionError:
|
54 |
+
st.error("β ERRORE: La cartella /app/.cache non ha permessi di scrittura!")
|
55 |
+
|
56 |
# π Carica il dataset direttamente da Hugging Face
|
57 |
dataset = load_dataset("sradc/imagenet_resized_64x64", split="train")
|
58 |
|