czl commited on
Commit
c5a3c44
1 Parent(s): f821cb0

add zeroGPU support

Browse files
Files changed (2) hide show
  1. app.py +2 -0
  2. requirements.txt +2 -1
app.py CHANGED
@@ -2,6 +2,7 @@ import random
2
 
3
  import gradio as gr
4
  import numpy as np
 
5
  import torch
6
  import torchvision.transforms as transforms
7
  from PIL import Image
@@ -33,6 +34,7 @@ MAX_SEED = np.iinfo(np.int32).max
33
  MAX_IMAGE_SIZE = 1024
34
 
35
 
 
36
  def infer(
37
  input_image,
38
  prompt1,
 
2
 
3
  import gradio as gr
4
  import numpy as np
5
+ import spaces
6
  import torch
7
  import torchvision.transforms as transforms
8
  from PIL import Image
 
34
  MAX_IMAGE_SIZE = 1024
35
 
36
 
37
+ @spaces.GPU
38
  def infer(
39
  input_image,
40
  prompt1,
requirements.txt CHANGED
@@ -10,4 +10,5 @@ DeepCache
10
  pandas
11
  numpy
12
  torchmetrics[image]
13
- gradio
 
 
10
  pandas
11
  numpy
12
  torchmetrics[image]
13
+ gradio
14
+ spaces