scontess commited on
Commit
ec2d61e
Β·
1 Parent(s): f3ee846
Files changed (2) hide show
  1. Dockerfile +6 -1
  2. 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 777 /app/.cache
 
 
 
 
 
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