Spaces:
Running
Running
Update Dockerfile
Browse files- 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 |
-
|
|
|
|
|
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)"
|