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

fix #5229 #5235

Merged
merged 5 commits into from Aug 16, 2023
Merged

fix #5229 #5235

merged 5 commits into from Aug 16, 2023

Conversation

breengles
Copy link
Contributor

Description

Add checking if a file already exists when include_audio=False has been used with gradio.Video (similar to the default behavior).

Closes: #5229 (cc: @abidlabs)

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
    --- All passed (with 74 warnings, tbh)

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh
    --- It affects mainly CHANGELOG.md files in different places, should be ok with the proposed changes to the Video component.

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Aug 15, 2023

🪼 branch checks and previews

Name Status URL
🦄 Changes detected! Details

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Aug 15, 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.

fix #5229

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.

@@ -239,6 +239,8 @@ def preprocess(
return output_file_name
elif not self.include_audio:
output_file_name = str(file_name.with_name(f"muted_{file_name.name}"))
if Path(output_file_name).exists():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please add a unit test @breengles ? Otherwise looks good!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @freddyaboulton! I added a simple test just like the one for the default behavior of gr.Video()

@freddyaboulton freddyaboulton merged commit 1ecf88a into gradio-app:main Aug 16, 2023
12 of 16 checks passed
@freddyaboulton
Copy link
Collaborator

Thank you for the contribution @breengles !

@pngwn pngwn mentioned this pull request Aug 16, 2023
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.

[Video] Video component does not check if file already exists when include_audio=False
3 participants