Spaces:
Runtime error
Runtime error
import gradio as gr | |
#from gradio_test_01 import dec_video | |
#vr = '/tmp/gradio/3342a56acc37b5a8b6d2d3453d8f4c3bd707753d/video_demo_02.mp4' | |
# 修改函数 | |
def audioToText1(file): | |
return 1 | |
def audioToText2(file): | |
return 2 | |
def audioToText3(file): | |
return 3 | |
with gr.Blocks() as demo: | |
# 使用 Markdown 输出一句话或标题 | |
gr.Markdown( | |
""" | |
# 诈骗内容检测 | |
视频 音频 文本 | |
""") | |
with gr.Row(): | |
with gr.Column(scale=1): | |
# 设置输入组件 | |
name = gr.Video(label="诈骗检测") | |
with gr.Column(scale=1): | |
# 设置输出组件 | |
output1 = gr.Textbox(label="虚假视频概率") | |
output2 = gr.Textbox(label="虚假音频概率") | |
output3 = gr.Textbox(label="诈骗文本概率") | |
# 设置按钮 | |
greet_btn = gr.Button("保存文件") | |
# 设置按钮点击事件 | |
greet_btn.click(fn=audioToText1, inputs=name, outputs=output1) | |
greet_btn.click(fn=audioToText2, inputs=name, outputs=output2) | |
greet_btn.click(fn=audioToText3, inputs=name, outputs=output3) | |
demo.launch(share=False, show_error = True) |