Spaces:
Sleeping
Sleeping
[Fix] Update gradio version to enable gr.render
Browse files
README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
emoji: 💻
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: bsd-3-clause
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Inverse Imaging Solver
|
| 3 |
emoji: 💻
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: yellow
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.23.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: bsd-3-clause
|
app.py
CHANGED
|
@@ -268,4 +268,15 @@ with gr.Blocks(title=title, css=custom_css) as interface:
|
|
| 268 |
metrics_placeholder],
|
| 269 |
outputs=[idx_slider, clean, y_image, model_a_out, model_b_out, physics_params, y_metrics, out_a_metric, out_b_metric])
|
| 270 |
|
| 271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
metrics_placeholder],
|
| 269 |
outputs=[idx_slider, clean, y_image, model_a_out, model_b_out, physics_params, y_metrics, out_a_metric, out_b_metric])
|
| 270 |
|
| 271 |
+
def launch_gradio(gradio_interface):
|
| 272 |
+
"""Launch Gradio on JupyterHub."""
|
| 273 |
+
server = "https://jupyterhub.idris.fr"
|
| 274 |
+
port = random.randint(1111, 2222) # need to set a new port for each instance of gradio on the same machine
|
| 275 |
+
root_path = f'{os.environ["JUPYTERHUB_SERVICE_PREFIX"]}proxy/{port}/'
|
| 276 |
+
print("Gradio Interface available on :", server + root_path)
|
| 277 |
+
gradio_interface.launch(
|
| 278 |
+
root_path=root_path,
|
| 279 |
+
server_port=port,
|
| 280 |
+
)
|
| 281 |
+
|
| 282 |
+
launch_gradio(interface)
|