-
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
modify preprocess to use pydantic models #6181
Conversation
🪼 branch checks and previews
The demo notebooks don't match the run.py files. Please run this command from the root of the repo and then commit the changes: pip install nbformat && cd demo && python generate_notebooks.py Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/07fb02725147b1a7b0e52236b7a44d929adcf053/gradio-4.0.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@07fb02725147b1a7b0e52236b7a44d929adcf053#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.
|
@@ -1260,6 +1260,14 @@ def preprocess_data( | |||
inputs_cached = processing_utils.move_files_to_cache( | |||
inputs[i], block | |||
) | |||
if getattr(block, "data_model", None) and inputs_cached is not None: | |||
if issubclass(block.data_model, GradioModel): # type: ignore | |||
print("block.data_model", block.data_model, block) |
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.
Can we get rid of the print statements?
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.
Oops I'll do it on @dawoodkhan82's branch, thanks for catching
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.
Done here: #6137
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.
Let me know if you find anything else! I merged this just now so that we could have everything in place and do another release
* modify preprocess to use pydantic models * changes * add changeset * fix * fix * fix typing * save * revert queuing changes * fix * fix * notebook * fix * changes * add changeset * fix functional tests --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Part II of #6176