BeveledCube commited on
Commit
bd7827c
1 Parent(s): c5e966e
Files changed (4) hide show
  1. .env +1 -3
  2. Dockerfile +0 -3
  3. main.py +2 -1
  4. requirements.txt +2 -1
.env CHANGED
@@ -1,3 +1 @@
1
- HF_HOME=/home/container/models
2
- TRANSFORMERS_CACHE=/home/container/cache
3
- TMPDIR=/home/container/cache
 
1
+ HF_HOME=/api/models
 
 
Dockerfile CHANGED
@@ -7,9 +7,6 @@ COPY --chown=user ./ /api/
7
  RUN pip install --upgrade pip
8
  RUN pip install -r requirements.txt
9
 
10
- RUN mkdir /api/cache
11
- RUN chmod a+rwx /api/cache
12
-
13
  RUN mkdir /api/models
14
  RUN chmod a+rwx /api/models
15
 
 
7
  RUN pip install --upgrade pip
8
  RUN pip install -r requirements.txt
9
 
 
 
 
10
  RUN mkdir /api/models
11
  RUN chmod a+rwx /api/models
12
 
main.py CHANGED
@@ -22,7 +22,8 @@ def receive_data():
22
  print("Prompt:", data["prompt"])
23
 
24
  prompt = data["prompt"]
25
-
 
26
  image = pipe(prompt).images[0]
27
 
28
  # Convert the torch Tensor to a NumPy array and move to CPU
 
22
  print("Prompt:", data["prompt"])
23
 
24
  prompt = data["prompt"]
25
+
26
+ pipe.safety_checker = lambda images, **kwargs: (images, [False] * len(images))
27
  image = pipe(prompt).images[0]
28
 
29
  # Convert the torch Tensor to a NumPy array and move to CPU
requirements.txt CHANGED
@@ -2,4 +2,5 @@ diffusers
2
  transformers
3
  matplotlib
4
  flask
5
- torch
 
 
2
  transformers
3
  matplotlib
4
  flask
5
+ torch
6
+ accelerate