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

Update old function params #751

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions chapters/en/chapter9/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def reverse_audio(audio):
return reversed_audio


mic = gr.Audio(source="microphone", type="numpy", label="Speak here...")
mic = gr.Audio(sources=["microphone"], type="numpy", label="Speak here...")
gr.Interface(reverse_audio, mic, "audio").launch()
```

Expand Down Expand Up @@ -112,7 +112,7 @@ gr.Interface(
[
gr.Dropdown(notes, type="index"),
gr.Slider(minimum=4, maximum=6, step=1),
gr.Textbox(type="number", value=1, label="Duration in seconds"),
gr.Textbox(value=1, label="Duration in seconds"),
],
"audio",
).launch()
Expand Down Expand Up @@ -167,8 +167,8 @@ def transcribe_audio(mic=None, file=None):
gr.Interface(
fn=transcribe_audio,
inputs=[
gr.Audio(source="microphone", type="filepath", optional=True),
gr.Audio(source="upload", type="filepath", optional=True),
gr.Audio(sources=["microphone"], type="filepath"),
gr.Audio(sources=["upload"], type="filepath"),
],
outputs="text",
).launch()
Expand All @@ -183,4 +183,4 @@ That's it! You can now use this interface to transcribe audio. Notice here that
by passing in the `optional` parameter as `True`, we allow the user to either
provide a microphone or an audio file (or neither, but that will return an error message).

Keep going to see how to share your interface with others!
Keep going to see how to share your interface with others!
Loading