Spaces:
Sleeping
Sleeping
xzhou10 commited on
Commit ·
a5730fa
1
Parent(s): 147598c
fix: explicit launch config to bypass gradio_client schema crash + bind to 0.0.0.0
Browse filesshow_api=False: gradio 4.44 + the bundled gradio_client 0.x crashes
when generating the API schema for nested data structures with
dict-valued additionalProperties ('TypeError: argument of type bool is
not iterable'). We don't expose a programmatic client API, so dropping
the schema endpoint is harmless.
server_name=0.0.0.0 + server_port=7860: HF Spaces require explicit bind
to all interfaces and the canonical port; without it gradio defaults
to localhost which the Space proxy cannot reach (the 'When localhost
is not accessible, a shareable link must be created' error in the
Space build log).
app.py
CHANGED
|
@@ -250,4 +250,12 @@ with gr.Blocks(title="RobustBench-TC Leaderboard") as demo:
|
|
| 250 |
|
| 251 |
|
| 252 |
if __name__ == "__main__":
|
| 253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
|
| 251 |
|
| 252 |
if __name__ == "__main__":
|
| 253 |
+
# show_api=False: the bundled gradio_client 0.x crashes generating the
|
| 254 |
+
# API schema when our nested data has dict-valued additionalProperties
|
| 255 |
+
# ("TypeError: argument of type 'bool' is not iterable" in
|
| 256 |
+
# gradio_client/utils.py get_type). We don't expose a programmatic
|
| 257 |
+
# client, so dropping the schema endpoint is harmless.
|
| 258 |
+
# server_name=0.0.0.0 / port 7860: HF Space requires bind to all
|
| 259 |
+
# interfaces; without it gradio falls back to localhost which the
|
| 260 |
+
# Space proxy cannot reach.
|
| 261 |
+
demo.launch(server_name="0.0.0.0", server_port=7860, show_api=False)
|