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

Updated Guide: Real Time Speech Recognition #9349

Merged
merged 6 commits into from
Sep 16, 2024

Conversation

Nik-Kras
Copy link
Contributor

Description

By following the Guide I faced several errors. I decided to update the installation stage and code to prevent others from having same errors:

  • Added dependency to install
  • Updated code to handle audio with multiple channels (Whisper requires a single channel)

added necessary dependency
updated code to handle cases with stereo microphone
updated code for streaming
demo/asr/run.py Outdated
y = y.astype(np.float32)
y /= np.max(np.abs(y))

return transcriber({"sampling_rate": sr, "raw": y})["text"] # type: ignore

demo = gr.Interface(
transcribe,
gr.Audio(sources=["microphone"]),
gr.Audio(sources="microphone", type="numpy"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

type="numpy" is the default so I don't think we need it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, removed that
I admit I did this pull request quite fast as soon as I fixed it, so I didn't check if this parameter was necessary

@freddyaboulton freddyaboulton enabled auto-merge (squash) September 16, 2024 15:03
@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Sep 16, 2024

🪼 branch checks and previews

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

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/5623eadad274efd743d5a15d63fff9ef41ccfea1/gradio-4.44.0-py3-none-any.whl

Install Gradio Python Client from this PR

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

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/5623eadad274efd743d5a15d63fff9ef41ccfea1/gradio-client-1.5.2.tgz

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Sep 16, 2024

🦄 no changes detected

This Pull Request does not include changes to any packages.

__No changes detected. __

  • Maintainers can select this checkbox to manually select packages to update.

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 create the changelog file directly.

@freddyaboulton freddyaboulton merged commit b888db4 into gradio-app:main Sep 16, 2024
21 checks passed
freddyaboulton pushed a commit that referenced this pull request Sep 18, 2024
* Update real-time-speech-recognition.md

added necessary dependency

* Update run.py

updated code to handle cases with stereo microphone

* Update real-time-speech-recognition.md

improved english

* Update run.py

updated code for streaming

* Update run.py
abidlabs added a commit that referenced this pull request Sep 19, 2024
* guides

* Add demo

* guide

* Add info about Powershell client (#9343)

* clients

* add changeset

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* Remove lite/theme.css from the Git-managed file tree (#9335)

* Delete js/lite/src/theme.css from the Git managed file tree as it's dynamically generated

* Remove lite-related npm scripts from spa/package.json

* add changeset

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* 9227 chatinterface retry bug (#9316)

* first draft

* add code

* tip

* add changeset

* delete dead code

* Type check notebook

* consolidate like section with guide

* Add comments

* add value

* Lint

* lint

* guide

---------

Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: Abubakar Abid <[email protected]>

* Move icons into `IconButtonWrapper` (#9261)

* * update icon buttons
* add image editor specific icon button

* tweak hover

* margin tweak

* add changeset

* improve gr.Video button UI

* radius tweak

* ensure even spacing

* fix typechecks

* add changeset

* revert irrelevant changes

* typefix

* fix image editor buttons

* fix download link icon

* disable undo if no change events dispatched in model3d and video

* use icons with iconbuttonwrapper

* add iconbuttonwrapper around gallery share btn

* Revert "add iconbuttonwrapper around gallery share btn"

This reverts commit 4605302.

* add changeset

* design fixes

* add changeset

* move status tracker progress to  bottom of component

* add changeset

* use iconbutton for like/dislike

* fix lint error

* fix type errors

* type errors

* fix test

* revert undo icon change

* btn spacing

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* Added gradio-in-r (#9340)

* Added gradio-in-r

* add changeset

* section

* remove

* tweaks

* delete changeset

* R

* Updated using-gradio-in-other-programming-languages.md

---------

Co-authored-by: Abubakar Abid <[email protected]>
Co-authored-by: gradio-pr-bot <[email protected]>

* Enhance Lite E2E tests and fix a networking problem on Lite (#9333)

* Add Lite E2E test to check a matplotlib problem which was fixed in #9312

* Restore js/app/test/image_remote_url.spec.ts, which was deleted in #8716

* Fix tootils import

* Format

* Fix processing_utils.resolve_with_google_dns to use the HTTPX client instead of urllib so it works on Lite

* add changeset

* add changeset

* Move js/app/test/image_remote_url.spec.ts -> js/spa/test/image_remote_url.spec.ts

* Use pyodide.http in resolve_with_google_dns on Lite

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* Do not attach `content_disposition_type = "attachment"` headers for files explicitly allowed by developer (#9348)

* changes

* add changeset

* format

* fix type

* type

* add test

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* Fix overflowing markdown in Chatbot (#9260)

* fix markdown overflowing table

* add changeset

* revert undo icon

* add changeset

* Revert "revert undo icon"

This reverts commit 855b012.

* add changeset

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* demo name

* Guide on Streaming Video for Object Detection (#9365)

* Add code

* notebooks

* Suggestions

* Add gif

* Small tweak to how thoughts are shown in `gr.Chatbot` (#9359)

* thiknk chat

* add changeset

* lint

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* Use `container` param in `gr.Markdown` (#9356)

* * add param
* add story

* add changeset

* Use IconButton for copy btn

* fix test

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* small fixes (#9347)

* Updated Guide: Real Time Speech Recognition (#9349)

* Update real-time-speech-recognition.md

added necessary dependency

* Update run.py

updated code to handle cases with stereo microphone

* Update real-time-speech-recognition.md

improved english

* Update run.py

updated code for streaming

* Update run.py

* chunk space uploads (#9360)

* chunk space uploads

* Update upload_demo_to_space.py

Co-authored-by: Lucain <[email protected]>

* address comments + tweak CI

---------

Co-authored-by: Lucain <[email protected]>

* add find (#9368)

* New branch (#9369)

* add find

* fix syntax

* New branch (#9370)

* add find

* fix syntax

* add hidden files

* run format

* Testing CI  (#9379)

* remove unnecessary redirects

* add changeset

* fix

* formatting

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* Fixes website build in 5.0-dev (#9382)

* changes

* add changeset

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* Small tweaks to improve the DX for the "tuples"/"messages" argument in `gr.Chatbot` (#9358)

* change format

* format

* add changeset

* revert

* revert

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* Update babylon.js to `v7` for `gr.Model3D` (#9377)

* update package.json

* add changeset

* add changeset

* update pnpm lock

* add changeset

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* Fix `gr.ImageEditor` toolbar cutoff (#9371)

* fix wrap alignment

* add changeset

---------

Co-authored-by: gradio-pr-bot <[email protected]>

* add lite upload (#9385)

* fix sha (#9386)

* Fix lite ci (#9387)

* fix sha

* fix name

* fix name

* Add code

* feedback

* link

* add changeset

* code

* check

* Update guides/04_additional-features/02_streaming-outputs.md

* Update guides/07_streaming/02_object-detection-from-webcam.md

---------

Co-authored-by: Abubakar Abid <[email protected]>
Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: Yuichiro Tachibana (Tsuchiya) <[email protected]>
Co-authored-by: Hannah <[email protected]>
Co-authored-by: Ifeanyi Idiaye <[email protected]>
Co-authored-by: Julien Chaumond <[email protected]>
Co-authored-by: Nikita Krasnytskyi <[email protected]>
Co-authored-by: pngwn <[email protected]>
Co-authored-by: Lucain <[email protected]>
Co-authored-by: Ali Abdalla <[email protected]>
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.

3 participants