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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -1
Dockerfile CHANGED
@@ -10,8 +10,13 @@ COPY requirements.txt .
10
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
11
 
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
  # Pre-download Stable Diffusion v1-5 weights into cache
17
  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)"
 
10
  RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
11
 
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)"