Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,10 @@ footer {visibility: hidden; }
|
|
10 |
</style>
|
11 |
"""
|
12 |
|
|
|
|
|
|
|
|
|
13 |
demo = gr.Blocks()
|
14 |
|
15 |
def fx1(x):
|
@@ -33,6 +37,9 @@ def fx4(x):
|
|
33 |
url_s="https://tts.baidu.com/text2audio?tex="+x+"&cuid=baike&lan=ZH&ie=utf-8&ctp=1&pdt=301&vol=9&rate=32&per=0"
|
34 |
return "点击音频文件 [voice]("+url_s+")"
|
35 |
|
|
|
|
|
|
|
36 |
with demo:
|
37 |
gr.Markdown(
|
38 |
"""
|
@@ -56,10 +63,14 @@ with demo:
|
|
56 |
TS_input = gr.Textbox(placeholder='请输入测试字符串,如"欢迎测试字符串转语音功能模块"',label="请输入测试内容",show_label=True)
|
57 |
audio_output = gr.Markdown(label="点击生成音频文件",show_label=True)
|
58 |
tts_button = gr.Button("开始转换>>")
|
|
|
|
|
|
|
59 |
|
60 |
tj_button.click(fx1, inputs=text_input, outputs=text_output)
|
61 |
cs_button.click(fx2, inputs=val_input, outputs=json_output)
|
62 |
dq_button.click(fx3, inputs=file_input, outputs=table_output)
|
63 |
tts_button.click(fx4, inputs=TS_input, outputs=audio_output)
|
|
|
64 |
|
65 |
demo.launch()
|
|
|
10 |
</style>
|
11 |
"""
|
12 |
|
13 |
+
html_code='''
|
14 |
+
<iframe src="https://web.powerva.microsoft.com/environments/Default-51a58d6c-4fcf-4b75-8608-d00bf7f244d5/bots/new_bot_830e155fc862429e89683426b31c9bd5/webchat" height="500" frameborder="1" style="width:100%"></iframe>
|
15 |
+
'''
|
16 |
+
|
17 |
demo = gr.Blocks()
|
18 |
|
19 |
def fx1(x):
|
|
|
37 |
url_s="https://tts.baidu.com/text2audio?tex="+x+"&cuid=baike&lan=ZH&ie=utf-8&ctp=1&pdt=301&vol=9&rate=32&per=0"
|
38 |
return "点击音频文件 [voice]("+url_s+")"
|
39 |
|
40 |
+
def fx5():
|
41 |
+
return html_code
|
42 |
+
|
43 |
with demo:
|
44 |
gr.Markdown(
|
45 |
"""
|
|
|
63 |
TS_input = gr.Textbox(placeholder='请输入测试字符串,如"欢迎测试字符串转语音功能模块"',label="请输入测试内容",show_label=True)
|
64 |
audio_output = gr.Markdown(label="点击生成音频文件",show_label=True)
|
65 |
tts_button = gr.Button("开始转换>>")
|
66 |
+
with gr.TabItem("Power Virtual Agents"):
|
67 |
+
pva_button = gr.Button("调用机器人对话>>")
|
68 |
+
pva_output=gr.Html(html_code,label="机器人聊天窗口",show_label=True)
|
69 |
|
70 |
tj_button.click(fx1, inputs=text_input, outputs=text_output)
|
71 |
cs_button.click(fx2, inputs=val_input, outputs=json_output)
|
72 |
dq_button.click(fx3, inputs=file_input, outputs=table_output)
|
73 |
tts_button.click(fx4, inputs=TS_input, outputs=audio_output)
|
74 |
+
pva_button.click(fx5, inputs=[],outputs=pva_output)
|
75 |
|
76 |
demo.launch()
|