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
Adds an "API Recorder" to the view API page, some internal methods have been made async #7850
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/1964726794e24b64ccbeb085a36e1a6bb25a64bf/gradio-4.25.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@1964726794e24b64ccbeb085a36e1a6bb25a64bf#subdirectory=client/python" |
🦄 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.
|
Should be ready for review. Addressed the comments from sync @aliabd @dawoodkhan82! |
Yeah sorry I pushed some WIP stuff that broke it. Let me revert to draft |
Ok so I believe this should fix everything, including the Lite E2E test. I adopted @freddyaboulton's suggestion and had two different versions of the @aliabid94 I tested the |
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.
This PR is pretty much ready to go @abidlabs ! Noticed a couple of small issues in the generated python calls:
- If the function has no arguments, the call will be
client.predict(, api_name="/...")
which is not valid syntax (empty comma) - The python docs show the javascript
null
as opposed toNone
so the python calls can't be used as-is.
Would appreciate if @aliabd and @dawoodkhan82 can take a closer look at the UI and js!
Thanks for adding the kitchen sink e2e lite test @whitphx. That caught an issue, fixing rn |
Thanks @freddyaboulton, I can repro the first issue that you described, but not the second: When I run this for example: import gradio as gr
with gr.Blocks() as demo:
t1 = gr.Textbox()
t2 = gr.Image()
t1.submit(lambda x,y:x, [t1, t2], t2)
demo.launch() Here's the recorded snippet I see, which shows Can you provide a repro for what you're seeing? |
@freddyaboulton both issues have been fixed now. Will go ahead and merge in this PR if CI passes. |
This PR adds an "API Recorder" to Gradio's View API page, which should make it easier for developers to use Gradio / Spaces via API.
Closes: #7128