-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Added support for show_api in mount_gradio_app #10097
Fix: Added support for show_api in mount_gradio_app #10097
Conversation
Hi @freddyaboulton , could you please approve the workflows for this PR? Thanks! |
Thanks for the contribution @HongweiRuan! The |
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/c0dfe5fd58b0e3dbad416e6552ef35e11d7ece52/gradio-5.8.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@c0dfe5fd58b0e3dbad416e6552ef35e11d7ece52#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/c0dfe5fd58b0e3dbad416e6552ef35e11d7ece52/gradio-client-1.8.0.tgz Use Lite from this PR <script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/c0dfe5fd58b0e3dbad416e6552ef35e11d7ece52/dist/lite.js""></script> |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
Hi @abidlabs, Thank you for the clarification! This is my very first time trying to make contributions. The original issue described the problem as follows: "I create a Gradio app using mount_gradio_app so I don't need to use the launch function call. I want to hide the "Use via API" on the footer. I try to add app_kwargs={"show_api": False} when calling the mount_gradio_app() and the "Use via API" message is still shown on the footer." Based on this description, I initially thought the user wanted to achieve this functionality via app_kwargs={"show_api": False}, which led to my initial implementation. I now understand from your explanation that show_api is an attribute of Blocks, not FastAPI. I’m happy to continue fixing this issue following your suggestion to add show_api as a separate argument in mount_gradio_app. |
Yes thanks for the explanation @HongweiRuan please feel free to make any modifications to this PR and we can review |
@HongweiRuan are you able to tweak your PR based on my suggestion above? |
Hi @abidlabs, sorry I was preparing for my final exams these days and haven't got a time to fix it, can I fix it in several days? |
Yea should be fine @HongweiRuan . We just don't want to leave forgotten PRs open or stale! |
Yes, I will definitely look into it when I got some time. |
Hi @abidlabs @freddyaboulton, could you check my newest commit please? I think that fixes the problem, thank you! |
Hi @abidlabs @freddyaboulton ,sorry there was one blank line contained a whitespace in my code causes one test to fail, I have fixed that and should be good to test again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm thanks @HongweiRuan!
@abidlabs Thank you very much for your support and patience on my first contribution! |
Fix: Added support for show_api in mount_gradio_app
Description
The
mount_gradio_app
function did not previously support theshow_api
parameter, which caused the "Use via API" button to always appear, regardless of the user's intent.Changes
show_api
inmount_gradio_app
.show_api
is correctly passed to theBlocks
instance.Closes: #9980