Skip to content

Adds a demo to show how a sound alert can be played when a prediction is complete#2478

Merged
abidlabs merged 5 commits into
mainfrom
sound
Oct 18, 2022
Merged

Adds a demo to show how a sound alert can be played when a prediction is complete#2478
abidlabs merged 5 commits into
mainfrom
sound

Conversation

@abidlabs
Copy link
Copy Markdown
Member

@abidlabs abidlabs commented Oct 18, 2022

Adds a demo (sound_alert.py) to show how a sound alert can be played when a prediction is complete.

CLoses: #2173

Comment thread demo/gif_maker/run.py
import cv2
import gradio as gr
import tempfile

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just removes some unused imports I noticed

@github-actions
Copy link
Copy Markdown
Contributor

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-2478-all-demos

@aliabd
Copy link
Copy Markdown
Contributor

aliabd commented Oct 18, 2022

Nice @abidlabs

I'm seeing a console error on the demo, even though it runs as expected

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'forEach')
    at $ (index.b57b8f62.js:55:2384)

Also, consider adding the demo to the docstrings where applicable (maybe at blocks?) or to the demos page. Otherwise LGTM

@abidlabs
Copy link
Copy Markdown
Member Author

Thanks for the review @aliabd! Will address these

Copy link
Copy Markdown
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.

Looks good to me @abidlabs!

@dawoodkhan82
Copy link
Copy Markdown
Collaborator

dawoodkhan82 commented Oct 18, 2022

works for me. nice demo!

@abidlabs
Copy link
Copy Markdown
Member Author

Thanks for the review folks! @aliabd I believe the JS error is happening because this event trigger doesn't have any inputs or outputs. Gonna leave that for a future PR but I've gone ahead and added this demo the Blocks class.

@abidlabs abidlabs merged commit d7c96e1 into main Oct 18, 2022
@abidlabs abidlabs deleted the sound branch October 18, 2022 20:03
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.

Optional Audio/Sound alert when a job is complete

4 participants