Fix API info bug (#9700)

* copy

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
Freddy Boulton 2024-10-17 11:11:02 -07:00 committed by GitHub
parent 2ade59b95d
commit 2932e067d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": patch
---
fix:Fix API info bug

View File

@ -576,7 +576,8 @@ class App(FastAPI):
app.all_app_info = app.get_blocks().get_api_info(all_endpoints=True)
return app.all_app_info
if not app.api_info:
api_info = cast(dict[str, Any], app.get_blocks().get_api_info())
api_info = utils.safe_deepcopy(app.get_blocks().get_api_info())
api_info = cast(dict[str, Any], api_info)
api_info = route_utils.update_example_values_to_use_public_url(api_info)
app.api_info = api_info
return app.api_info