Spaces:
Runtime error
Runtime error
Sophia Yang
commited on
Commit
·
f6a7a21
1
Parent(s):
dd213e4
use Nvidia docker image
Browse files- Dockerfile +17 -4
- app.py +0 -2
Dockerfile
CHANGED
@@ -1,11 +1,24 @@
|
|
1 |
-
FROM
|
2 |
-
FROM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
WORKDIR /code
|
5 |
|
6 |
COPY ./requirements.txt /code/requirements.txt
|
7 |
-
|
8 |
-
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
9 |
|
10 |
COPY . .
|
11 |
|
|
|
1 |
+
# FROM python:3.9
|
2 |
+
FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04
|
3 |
+
LABEL maintainer="Hugging Face"
|
4 |
+
LABEL repository="transformers"
|
5 |
+
|
6 |
+
RUN apt update && \
|
7 |
+
apt install -y bash \
|
8 |
+
build-essential \
|
9 |
+
git \
|
10 |
+
curl \
|
11 |
+
ca-certificates \
|
12 |
+
python3 \
|
13 |
+
python3-pip && \
|
14 |
+
rm -rf /var/lib/apt/lists
|
15 |
+
|
16 |
|
17 |
WORKDIR /code
|
18 |
|
19 |
COPY ./requirements.txt /code/requirements.txt
|
20 |
+
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
21 |
+
RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
22 |
|
23 |
COPY . .
|
24 |
|
app.py
CHANGED
@@ -30,8 +30,6 @@ else:
|
|
30 |
model_id
|
31 |
)
|
32 |
pipe = pipe.to(device)
|
33 |
-
pipe.enable_xformers_memory_efficient_attention()
|
34 |
-
pipe.unet.to(memory_format=torch.channels_last)
|
35 |
|
36 |
|
37 |
def new_image(prompt, image, img_guidance, guidance, steps):
|
|
|
30 |
model_id
|
31 |
)
|
32 |
pipe = pipe.to(device)
|
|
|
|
|
33 |
|
34 |
|
35 |
def new_image(prompt, image, img_guidance, guidance, steps):
|