Spaces:
Running
Running
SathyaSantosh77 commited on
Commit ·
da49528
1
Parent(s): 02fa4e5
gr import modified
Browse files
app.py
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
import torch.nn as nn
|
|
@@ -473,4 +485,4 @@ with gr.Blocks(css=CSS, title="Dense-Iso-ViT SR") as demo:
|
|
| 473 |
|
| 474 |
|
| 475 |
if __name__ == "__main__":
|
| 476 |
-
demo.launch(
|
|
|
|
| 1 |
+
# patch gradio_client bug — "const" in bool raises TypeError
|
| 2 |
+
import gradio_client.utils as _gcu
|
| 3 |
+
_original_get_type = _gcu.get_type
|
| 4 |
+
|
| 5 |
+
def _patched_get_type(schema):
|
| 6 |
+
if not isinstance(schema, dict):
|
| 7 |
+
return "Any"
|
| 8 |
+
return _original_get_type(schema)
|
| 9 |
+
|
| 10 |
+
_gcu.get_type = _patched_get_type
|
| 11 |
+
|
| 12 |
+
# now import gradio normally
|
| 13 |
import gradio as gr
|
| 14 |
import torch
|
| 15 |
import torch.nn as nn
|
|
|
|
| 485 |
|
| 486 |
|
| 487 |
if __name__ == "__main__":
|
| 488 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|