Spaces:
Runtime error
Runtime error
scontess
commited on
Commit
Β·
ec2d61e
1
Parent(s):
f3ee846
pippo
Browse files- Dockerfile +6 -1
- src/streamlit_app.py +3 -0
Dockerfile
CHANGED
@@ -16,7 +16,12 @@ RUN pip3 install -r requirements.txt
|
|
16 |
|
17 |
RUN chmod -R 755 /app
|
18 |
|
19 |
-
RUN mkdir -p /app/.cache && chmod -R
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
EXPOSE 8501
|
22 |
|
|
|
16 |
|
17 |
RUN chmod -R 755 /app
|
18 |
|
19 |
+
RUN mkdir -p /app/.cache && chmod -R 755 /app/.cache
|
20 |
+
|
21 |
+
ENV HF_HOME=/tmp/huggingface
|
22 |
+
ENV HF_DATASETS_CACHE=/tmp/huggingface
|
23 |
+
RUN mkdir -p /tmp/huggingface && chmod -R 777 /tmp/huggingface
|
24 |
+
|
25 |
|
26 |
EXPOSE 8501
|
27 |
|
src/streamlit_app.py
CHANGED
@@ -57,6 +57,9 @@ except PermissionError:
|
|
57 |
|
58 |
|
59 |
# π Carica il dataset direttamente da Hugging Face
|
|
|
|
|
|
|
60 |
dataset = load_dataset("zh-plus/tiny-imagenet", split="train")
|
61 |
|
62 |
# π Recupera il primo esempio
|
|
|
57 |
|
58 |
|
59 |
# π Carica il dataset direttamente da Hugging Face
|
60 |
+
os.environ["HF_HOME"] = "/tmp/huggingface"
|
61 |
+
os.environ["HF_DATASETS_CACHE"] = "/tmp/huggingface"
|
62 |
+
os.makedirs(os.getenv("HF_DATASETS_CACHE"), exist_ok=True)
|
63 |
dataset = load_dataset("zh-plus/tiny-imagenet", split="train")
|
64 |
|
65 |
# π Recupera il primo esempio
|