KarthikAI commited on
Commit
b2df948
·
verified ·
1 Parent(s): 9a7767a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -5
Dockerfile CHANGED
@@ -12,11 +12,19 @@ RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
12
  # Set Hugging Face cache for all model downloads (best practice for Spaces)
13
  # ENV HF_HOME="/workspace/.cache/huggingface"
14
  # RUN mkdir -p /workspace/.cache/huggingface
15
- ENV CACHE_DIR="/workspace/.cache"
16
- ENV HF_HOME="/workspace/.cache/huggingface"
17
- ENV TRANSFORMERS_CACHE="/workspace/.cache/huggingface"
18
- RUN mkdir -p /workspace/.cache/huggingface/hub && \
19
- chmod -R 777 /workspace/.cache
 
 
 
 
 
 
 
 
20
 
21
  # Pre-download Stable Diffusion v1-5 weights into cache
22
  RUN python -c "import torch; from diffusers import StableDiffusionImg2ImgPipeline; StableDiffusionImg2ImgPipeline.from_pretrained('runwayml/stable-diffusion-v1-5', cache_dir='/workspace/.cache/huggingface', torch_dtype=torch.float32)"
 
12
  # Set Hugging Face cache for all model downloads (best practice for Spaces)
13
  # ENV HF_HOME="/workspace/.cache/huggingface"
14
  # RUN mkdir -p /workspace/.cache/huggingface
15
+
16
+
17
+ # ENV CACHE_DIR="/workspace/.cache"
18
+ # ENV HF_HOME="/workspace/.cache/huggingface"
19
+ # ENV TRANSFORMERS_CACHE="/workspace/.cache/huggingface"
20
+ # RUN mkdir -p /workspace/.cache/huggingface/hub && \
21
+ # chmod -R 777 /workspace/.cache
22
+
23
+ ENV CACHE_DIR="/data"
24
+ ENV HF_HOME="/data/huggingface"
25
+ ENV TRANSFORMERS_CACHE="/data/huggingface"
26
+ RUN mkdir -p /data/huggingface/.locks && chmod -R 777 /data
27
+
28
 
29
  # Pre-download Stable Diffusion v1-5 weights into cache
30
  RUN python -c "import torch; from diffusers import StableDiffusionImg2ImgPipeline; StableDiffusionImg2ImgPipeline.from_pretrained('runwayml/stable-diffusion-v1-5', cache_dir='/workspace/.cache/huggingface', torch_dtype=torch.float32)"