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

Gradio microphone input forwards empty values on Spaces #8184

Open
1 task done
sanchit-gandhi opened this issue May 1, 2024 · 0 comments
Open
1 task done

Gradio microphone input forwards empty values on Spaces #8184

sanchit-gandhi opened this issue May 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sanchit-gandhi
Copy link

sanchit-gandhi commented May 1, 2024

Describe the bug

Using the microphone input on Spaces is temperamental, often forwarding empty inputs to our function.

Response from @abidlabs:

So my hunch is that the audio component takes a little while to upload the recording to the backend and update its value. If you click the button before the audio upload is incomplete, then it will just send an empty value instead

This is going to be more pronounced on Spaces since there's additional latency involved in uploading the audio file

My suggestion would be to keep the button non-interactive and then define an audio.upload() event (that triggers after the upload is complete) to make the generate audio button interactive

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

Created a reproducible example to showcase this: https://huggingface.co/spaces/sanchit-gandhi/audio-component

In this demo, we expect the audio output component to return the same audio that we input (i.e. an identity function).

However, we see that the microphone input isn’t passed to the function in our demo, and thus the audio output is None

If you run this locally, you’ll find that the microphone input is passed to the identity function in our demo, and that it is returned as the output as expected

Screenshot

Screen.Recording.2024-04-24.at.19.24.52.mov

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Darwin
gradio version: 4.28.3
gradio_client version: 0.16.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.3.0
fastapi: 0.110.2
ffmpy: 0.3.2
gradio-client==0.16.0 is not installed.
httpx: 0.26.0
huggingface-hub: 0.22.1
importlib-resources: 6.1.1
jinja2: 3.1.3
markupsafe: 2.1.5
matplotlib: 3.8.3
numpy: 1.26.4
orjson: 3.10.1
packaging: 23.2
pandas: 2.2.0
pillow: 10.2.0
pydantic: 2.7.1
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.4.1
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.3
typing-extensions: 4.9.0
urllib3: 2.2.1
uvicorn: 0.29.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2023.10.0
httpx: 0.26.0
huggingface-hub: 0.22.1
packaging: 23.2
typing-extensions: 4.9.0
websockets: 11.0.3

Severity

I can work around it

@sanchit-gandhi sanchit-gandhi added the bug Something isn't working label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant