mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-23 11:39:17 +08:00
* fix * add changeset * add changeset * notebooks --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
26 lines
586 B
Python
26 lines
586 B
Python
import gradio as gr
|
|
|
|
tts_examples = [
|
|
"I love learning machine learning",
|
|
"How do you do?",
|
|
]
|
|
|
|
tts_demo = gr.load(
|
|
"huggingface/facebook/fastspeech2-en-ljspeech",
|
|
title=None,
|
|
examples=tts_examples,
|
|
description="Give me something to say!",
|
|
)
|
|
|
|
stt_demo = gr.load(
|
|
"huggingface/facebook/wav2vec2-base-960h",
|
|
title=None,
|
|
inputs=gr.Microphone(type="filepath"),
|
|
description="Let me try to guess what you're saying!",
|
|
)
|
|
|
|
demo = gr.TabbedInterface([tts_demo, stt_demo], ["Text-to-speech", "Speech-to-text"])
|
|
|
|
if __name__ == "__main__":
|
|
demo.launch()
|