anonymous-IA commited on
Commit
0b93ab8
·
verified ·
1 Parent(s): 496b291

Upload 41 files

Browse files
Files changed (2) hide show
  1. __pycache__/app.cpython-310.pyc +0 -0
  2. app.py +19 -1
__pycache__/app.cpython-310.pyc CHANGED
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
 
app.py CHANGED
@@ -14,6 +14,24 @@ import os
14
  from functools import lru_cache
15
 
16
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  import numpy as np
18
  import pandas as pd
19
  import torch
@@ -154,4 +172,4 @@ with gr.Blocks(title="GazeCorrect") as demo:
154
  csv_file.upload(load_csv, [csv_file, image_state], [points_state, panel, gaze_status])
155
  button.click(generate, [image_state, points_state, description, spread, degree, feather, strength, steps, seed], [gaze_out, noise_out, corrected_out, status])
156
 
157
- demo.queue().launch(server_name="0.0.0.0", server_port=7860, show_error=True)
 
14
  from functools import lru_cache
15
 
16
  import gradio as gr
17
+
18
+ # Gradio 4.44 can encounter JSON-schema ``additionalProperties: false`` in
19
+ # newer Space dependencies. Avoid generating an invalid API schema at startup.
20
+ try:
21
+ import gradio_client.utils as _gradio_client_utils
22
+ _schema_to_python_type = _gradio_client_utils._json_schema_to_python_type
23
+
24
+ def _safe_schema_to_python_type(schema, defs=None):
25
+ if not isinstance(schema, dict):
26
+ return "Any"
27
+ if not isinstance(schema.get("additionalProperties"), dict):
28
+ schema = {key: value for key, value in schema.items() if key != "additionalProperties"}
29
+ return _schema_to_python_type(schema, defs)
30
+
31
+ _gradio_client_utils._json_schema_to_python_type = _safe_schema_to_python_type
32
+ except Exception:
33
+ pass
34
+
35
  import numpy as np
36
  import pandas as pd
37
  import torch
 
172
  csv_file.upload(load_csv, [csv_file, image_state], [points_state, panel, gaze_status])
173
  button.click(generate, [image_state, points_state, description, spread, degree, feather, strength, steps, seed], [gaze_out, noise_out, corrected_out, status])
174
 
175
+ demo.queue().launch(show_error=True)