Skip to content
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

Remove deprecated .update() usage from Interface internals #5862

Merged
merged 5 commits into from
Oct 11, 2023

Conversation

abidlabs
Copy link
Member

We used the .update() logic various places inside Interface, which meant that a warning was raised e.g. any time you clicked on the Clear button or passed in an iterator. This replaces with modern syntax.

Test code:

import gradio as gr
import time

def identity(x):
    for i in range(len(x)):
        time.sleep(0.5)
        yield x[:i+1]
        
gr.Interface(identity, "textbox", "textbox").queue().launch()

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 11, 2023

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
Visual tests all good! Build review
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/f6120b83ca73c9173c96013e5c22dd99e7d7da74/gradio-3.47.1-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@f6120b83ca73c9173c96013e5c22dd99e7d7da74#subdirectory=client/python"

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 11, 2023

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Remove deprecated .update() usage from Interface internals

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@abidlabs abidlabs added the v: patch A change that requires a patch release label Oct 11, 2023
Copy link
Collaborator

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a usage of update in the theme builder but other than that this looks good to me @abidlabs

gr.Markdown.update(

@abidlabs
Copy link
Member Author

Thanks for the review @freddyaboulton and nice catch. I'll fix the theme builder too and get this in.

@abidlabs abidlabs merged commit c07207e into main Oct 11, 2023
22 of 23 checks passed
@abidlabs abidlabs deleted the interface-update branch October 11, 2023 18:51
This was referenced Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v: patch A change that requires a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants