Spaces:
Running on Zero

Shafi99 commited on
Commit
5d77a3e
·
verified ·
1 Parent(s): e15ab07

Add type hints required by gr.api

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -168,9 +168,11 @@ def restore(image):
168
  image.width, image.height, n, t_inf, t_inf / max(n, 1))
169
 
170
 
171
- def restore_api(image):
172
  """Lean endpoint for a standalone front end: the restored photo only.
173
 
 
 
174
  The caller already holds the original, so echoing it back would double the
175
  download for nothing. Returned as PNG, so nothing is re-compressed.
176
  """
 
168
  image.width, image.height, n, t_inf, t_inf / max(n, 1))
169
 
170
 
171
+ def restore_api(image: Image.Image) -> Image.Image:
172
  """Lean endpoint for a standalone front end: the restored photo only.
173
 
174
+ Type hints are required: gr.api refuses to register an endpoint without them.
175
+
176
  The caller already holds the original, so echoing it back would double the
177
  download for nothing. Returned as PNG, so nothing is re-compressed.
178
  """