Update app.py
Browse files
app.py
CHANGED
|
@@ -69,10 +69,8 @@ def fx_dt(dc,x,y):
|
|
| 69 |
gr.JSON(DT.names)
|
| 70 |
D_table=DT[:,sum(f[int(y-1)]),by(f[int(x-1)])]
|
| 71 |
return D_table.to_pandas()
|
| 72 |
-
'''
|
| 73 |
-
|
| 74 |
-
with demo:
|
| 75 |
-
with gr.Tabs(selected=5):
|
| 76 |
'''
|
| 77 |
with gr.TabItem("测试1"):
|
| 78 |
with gr.Column():
|
|
@@ -85,8 +83,31 @@ with demo:
|
|
| 85 |
gr.Markdown("# TTS文本字符串转语音合成训练")
|
| 86 |
TTS_input=gr.Textbox(label="输入文本")
|
| 87 |
TTS_button=gr.Button("合成")
|
| 88 |
-
TTS_button.click(inference, inputs=TTS_input, outputs=gr.Audio(label="输出合成结果"),api_name='tts')
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
with gr.TabItem("M-Formatter"):
|
| 91 |
gr.Markdown("# PowerQuery M语言脚本格式化测试")
|
| 92 |
M_input=gr.Textbox(label="请填写需要格式化的M脚本",lines=18)
|
|
@@ -108,28 +129,7 @@ with demo:
|
|
| 108 |
d_output=gr.DataFrame(label="输出>")
|
| 109 |
d_button=gr.Button("开始编译>>")
|
| 110 |
d_button.click(fx_datatable, inputs=d_input, outputs=d_output,api_name='pyexe')
|
| 111 |
-
'''
|
| 112 |
-
with gr.TabItem("钉钉群消息推送"):
|
| 113 |
-
gr.Markdown("# 推送测试")
|
| 114 |
-
dd_input=[gr.Textbox(label="请填写机器人token"),gr.Textbox(label="请填写需要推送的信息",lines=10)]
|
| 115 |
-
dd_output=gr.Textbox(label="推送提示")
|
| 116 |
-
dd_button=gr.Button("提交")
|
| 117 |
-
dd_button.click(fx_dd, inputs=dd_input, outputs=dd_output,api_name='dingding_robot')
|
| 118 |
-
|
| 119 |
-
with gr.TabItem("钉钉ocr"):
|
| 120 |
-
gr.Markdown("# 网络图片OCR识别")
|
| 121 |
-
ocr_input=[gr.Textbox(label="请填写ocr_token"),gr.Textbox(label="请填写图片网址"),gr.Radio(["身份证","增值税发票","营业执照","银行卡","车牌","机动车发票","驾驶证","行驶证","火车票","定额发票","出租车发票","机票行程单","审批表单","花名册"],value="营业执照增值税发票",label="请选择识别类型:")]
|
| 122 |
-
ocr_button=gr.Button("开始识别>>")
|
| 123 |
-
ocr_output=gr.JSON(label="识别结果")
|
| 124 |
-
ocr_button.click(dd_ocr, inputs=ocr_input, outputs=ocr_output,api_name='dingding_ocr')
|
| 125 |
|
| 126 |
-
with gr.TabItem("datatable"):
|
| 127 |
-
gr.Markdown("# datatable测试")
|
| 128 |
-
dt_input=[gr.File(label="选择需要读取的文档",type='bytes'),gr.Number(label='请输入分组列序号'),gr.Number(label='请输入聚合列序号')]
|
| 129 |
-
dt_output=gr.DataFrame(label="输出",max_rows=10,wrap=True)
|
| 130 |
-
dt_button=gr.Button("分类汇总")
|
| 131 |
-
dt_button.click(fx_dt, inputs=dt_input, outputs=dt_output,api_name='datatable')
|
| 132 |
-
'''
|
| 133 |
with gr.TabItem("js"):
|
| 134 |
gr.Markdown("# js处理测试")
|
| 135 |
a=gr.Textbox(label='请输入需要js处理的字符串')
|
|
|
|
| 69 |
gr.JSON(DT.names)
|
| 70 |
D_table=DT[:,sum(f[int(y-1)]),by(f[int(x-1)])]
|
| 71 |
return D_table.to_pandas()
|
| 72 |
+
'''
|
| 73 |
+
|
|
|
|
|
|
|
| 74 |
'''
|
| 75 |
with gr.TabItem("测试1"):
|
| 76 |
with gr.Column():
|
|
|
|
| 83 |
gr.Markdown("# TTS文本字符串转语音合成训练")
|
| 84 |
TTS_input=gr.Textbox(label="输入文本")
|
| 85 |
TTS_button=gr.Button("合成")
|
| 86 |
+
TTS_button.click(inference, inputs=TTS_input, outputs=gr.Audio(label="输出合成结果"),api_name='tts')
|
| 87 |
+
with gr.TabItem("钉钉群消息推送"):
|
| 88 |
+
gr.Markdown("# 推送测试")
|
| 89 |
+
dd_input=[gr.Textbox(label="请填写机器人token"),gr.Textbox(label="请填写需要推送的信息",lines=10)]
|
| 90 |
+
dd_output=gr.Textbox(label="推送提示")
|
| 91 |
+
dd_button=gr.Button("提交")
|
| 92 |
+
dd_button.click(fx_dd, inputs=dd_input, outputs=dd_output,api_name='dingding_robot')
|
| 93 |
+
|
| 94 |
+
with gr.TabItem("钉钉ocr"):
|
| 95 |
+
gr.Markdown("# 网络图片OCR识别")
|
| 96 |
+
ocr_input=[gr.Textbox(label="请填写ocr_token"),gr.Textbox(label="请填写图片网址"),gr.Radio(["身份证","增值税发票","营业执照","银行卡","车牌","机动车发票","驾驶证","行驶证","火车票","定额发票","出租车发票","机票行程单","审批表单","花名册"],value="营业执照增值税发票",label="请选择识别类型:")]
|
| 97 |
+
ocr_button=gr.Button("开始识别>>")
|
| 98 |
+
ocr_output=gr.JSON(label="识别结果")
|
| 99 |
+
ocr_button.click(dd_ocr, inputs=ocr_input, outputs=ocr_output,api_name='dingding_ocr')
|
| 100 |
+
|
| 101 |
+
with gr.TabItem("datatable"):
|
| 102 |
+
gr.Markdown("# datatable测试")
|
| 103 |
+
dt_input=[gr.File(label="选择需要读取的文档",type='bytes'),gr.Number(label='请输入分组列序号'),gr.Number(label='请输入聚合列序号')]
|
| 104 |
+
dt_output=gr.DataFrame(label="输出",max_rows=10,wrap=True)
|
| 105 |
+
dt_button=gr.Button("分类汇总")
|
| 106 |
+
dt_button.click(fx_dt, inputs=dt_input, outputs=dt_output,api_name='datatable')
|
| 107 |
+
'''
|
| 108 |
+
demo=gr.Blocks(css="#jsc:hover{background-color: red;}")
|
| 109 |
+
with demo:
|
| 110 |
+
with gr.Tabs(selected=5):
|
| 111 |
with gr.TabItem("M-Formatter"):
|
| 112 |
gr.Markdown("# PowerQuery M语言脚本格式化测试")
|
| 113 |
M_input=gr.Textbox(label="请填写需要格式化的M脚本",lines=18)
|
|
|
|
| 129 |
d_output=gr.DataFrame(label="输出>")
|
| 130 |
d_button=gr.Button("开始编译>>")
|
| 131 |
d_button.click(fx_datatable, inputs=d_input, outputs=d_output,api_name='pyexe')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
with gr.TabItem("js"):
|
| 134 |
gr.Markdown("# js处理测试")
|
| 135 |
a=gr.Textbox(label='请输入需要js处理的字符串')
|