AP123 cbensimon HF staff commited on
Commit
18274c1
1 Parent(s): 8e6c97d

ZeroGPU (#796)

Browse files

- ZeroGPU (4bdf74fe79687ebb8544720dd838eee0d3a153c0)
- Update app.py (12d957514d87b6a185b1c858c975a0a07ca89a5f)


Co-authored-by: Charles Bensimon <cbensimon@users.noreply.huggingface.co>

Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +3 -1
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 👁
4
  colorFrom: red
5
  colorTo: pink
6
  sdk: gradio
7
- sdk_version: 3.44.3
8
  app_file: app.py
9
  pinned: false
10
  license: openrail
 
4
  colorFrom: red
5
  colorTo: pink
6
  sdk: gradio
7
+ sdk_version: 4.14.0
8
  app_file: app.py
9
  pinned: false
10
  license: openrail
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import torch
2
  import gradio as gr
3
  from gradio import processing_utils, utils
@@ -106,6 +107,7 @@ def convert_to_base64(pil_image):
106
  return base64_image
107
 
108
  # Inference function
 
109
  def inference(
110
  control_image: Image.Image,
111
  prompt: str,
@@ -267,7 +269,7 @@ with gr.Blocks() as app:
267
  queue=False,
268
  postprocess=False
269
  )
270
- share_button.click(None, [], [], _js=share_js)
271
 
272
  with gr.Blocks(css=css) as app_with_history:
273
  with gr.Tab("Demo"):
 
1
+ import spaces
2
  import torch
3
  import gradio as gr
4
  from gradio import processing_utils, utils
 
107
  return base64_image
108
 
109
  # Inference function
110
+ @spaces.GPU
111
  def inference(
112
  control_image: Image.Image,
113
  prompt: str,
 
269
  queue=False,
270
  postprocess=False
271
  )
272
+ share_button.click(None, [], [], js=share_js)
273
 
274
  with gr.Blocks(css=css) as app_with_history:
275
  with gr.Tab("Demo"):