Create main.py
Browse files
main.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def fuduji(name):
|
| 4 |
+
return name
|
| 5 |
+
|
| 6 |
+
demo = gr.Interface(
|
| 7 |
+
title = "这是一个中文复读机",
|
| 8 |
+
description = """
|
| 9 |
+
1.输入中文,它会复读你所说的话\n
|
| 10 |
+
2.我爱huggingface
|
| 11 |
+
""",
|
| 12 |
+
fn=fuduji,
|
| 13 |
+
inputs=[
|
| 14 |
+
gr.Textbox(
|
| 15 |
+
label="输入要复读的中文",
|
| 16 |
+
lines=10,
|
| 17 |
+
),
|
| 18 |
+
],
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
outputs=[
|
| 24 |
+
gr.Textbox(
|
| 25 |
+
label="复读结果",
|
| 26 |
+
lines=10,
|
| 27 |
+
),
|
| 28 |
+
],
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
demo.launch()
|