Skip to content

Commit

Permalink
Fix API info bug (#9700)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Oct 17, 2024
1 parent 2ade59b commit 2932e06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/olive-lights-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": patch
---

fix:Fix API info bug
3 changes: 2 additions & 1 deletion gradio/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,8 @@ def api_info(request: fastapi.Request):
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
Expand Down

0 comments on commit 2932e06

Please sign in to comment.