gradio/demo/basic_text.py

15 lines
427 B
Python
Raw Normal View History

2020-06-10 08:00:30 +08:00
import gradio as gr
2020-06-19 04:15:27 +08:00
def answer_question(text1, text2):
return text1, text2, {"plagiarism": 0.62, "original": 0.38}
2020-06-11 14:04:14 +08:00
2020-06-19 04:15:27 +08:00
gr.Interface(answer_question,
2020-06-12 02:25:38 +08:00
[
2020-06-19 04:15:27 +08:00
gr.inputs.Microphone(label="speech"),
gr.inputs.Dropdown(["Deepspeech", "Sphynx", "Wav2Text"], label="model"),
], [
gr.outputs.Textbox(label="text 1", lines=8),
]
).launch()