-
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
Make the HTTP requests for the Wasm worker wait for the initial run_code()
or run_file()
to finish
#5958
Conversation
…code()` or `run_file()` to finish
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/98f864484c6642d3fb223b2bd5e5b7e3871bdab2/gradio-3.48.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@98f864484c6642d3fb223b2bd5e5b7e3871bdab2#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.
|
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.
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.
Clever. Looks good to me! Thanks @whitphx!
Works beautifully! Thanks @whitphx :) |
Description
Closes: #5957
This PR includes 2 major changes.
run_file()
orrun_code()
promise execution to finish. 1c99d20await
will be supported withrun_code()
. 4a95c94These 2 commits are related but independent, so I recommend to review them one by one.
The first one is the direct solution for the problem of #5957 .
The second one is to support top-level
await
syntax withrun_file()
or thefiles
option. The sample code of #5957 usesrun_code()
or thecode
option so it could include the top-levelawait
in the code. However, it has not worked with withrun_file()
or thefiles
option, so this PR fixes it.