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 static while pending behaviour #7410

Merged
merged 9 commits into from
Feb 14, 2024
Merged

remove static while pending behaviour #7410

merged 9 commits into from
Feb 14, 2024

Conversation

pngwn
Copy link
Member

@pngwn pngwn commented Feb 13, 2024

Description

Please include a concise summary, in clear English, of the changes in this pull request. If it closes an issue, please mention it here.

Closes #7175

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Feb 13, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
🦄 Changes detected! Details

Install Gradio from this PR

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

Install Gradio Python Client from this PR

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

@pngwn
Copy link
Member Author

pngwn commented Feb 13, 2024

I've tweaked a test here to get rid of some flake. The commented our part does not test anything (it will pass regardless) and causes the flake.

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Feb 13, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

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

With the following changelog entry.

remove static while pending behaviour

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.

@pngwn
Copy link
Member Author

pngwn commented Feb 13, 2024

Actually i know how to fix that test. Will amend.

Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason you removed the time.sleep? Without it, its not as clear that this is a streaming demo

Copy link
Member Author

Choose a reason for hiding this comment

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

Clear in what way? It returns an iterator.

Copy link
Member

Choose a reason for hiding this comment

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

Meaning visually when you run the demo, the text appears all at once, instead of the characters appearing one by one

Copy link
Member

Choose a reason for hiding this comment

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

This demo is used in the docs here:

$demo_chatinterface_streaming_echo

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, we should really have dedicated demo's for tests. WIll fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll create a new demo because i need to tweak the demo to fix the tests.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can use the _test suffix for designating test demos

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe a prefix, so they are easier to find in the fs?

@@ -525,22 +525,7 @@
.on("status", ({ fn_index, ...status }) => {
tick().then(() => {
const outputs = dependencies[fn_index].outputs;
outputs.forEach((id) => {
Copy link
Member

Choose a reason for hiding this comment

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

We can also delete the line above (508) which defines const pending_outputs: number[] = [];

Copy link
Member

Choose a reason for hiding this comment

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

We also have some additional logic involving outputs_set_to_non_interactive that can be deleted

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeh.

@pngwn
Copy link
Member Author

pngwn commented Feb 14, 2024

Okay I cleaned this up and got the tests passing (i think, CI will tell).

@pngwn
Copy link
Member Author

pngwn commented Feb 14, 2024

was wrong

@pngwn
Copy link
Member Author

pngwn commented Feb 14, 2024

okay i think it should work now.

Copy link
Member

@abidlabs abidlabs left a comment

Choose a reason for hiding this comment

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

LGTM nice @pngwn!

@pngwn pngwn merged commit c2dfc59 into main Feb 14, 2024
8 checks passed
@pngwn pngwn deleted the int-stat branch February 14, 2024 16:15
@pngwn pngwn mentioned this pull request Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to rework the 'static while pending' behaviour.
3 participants