changxin commited on
Commit
28e1c18
1 Parent(s): 2876f3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -3,6 +3,7 @@ import hashlib
3
  import tempfile
4
  import requests
5
  import pandas as pd
 
6
  from TTS.utils.manage import ModelManager
7
  from TTS.utils.synthesizer import Synthesizer
8
  def fx(x:str):
@@ -58,6 +59,11 @@ def dd_ocr(tk,sl,dt):
58
  data={"image_url":sl,"type":dc[dt]}
59
  response=requests.post(url,json=data,headers=headers)
60
  return response.json()
 
 
 
 
 
61
 
62
  demo=gr.Blocks()
63
  with demo:
@@ -94,7 +100,7 @@ with demo:
94
  d_input=gr.Textbox(label="请填写需要datatable库处理的脚本",lines=18)
95
  d_output=gr.JSON(label="输出>")
96
  d_button=gr.Button("开始编译>>")
97
- d_button.click(fx_datatable, inputs=d_input, outputs=d_output,api_name='datatable')
98
 
99
  with gr.TabItem("钉钉群消息推送"):
100
  gr.Markdown("# 推送测试")
@@ -109,5 +115,12 @@ with demo:
109
  ocr_button=gr.Button("开始识别>>")
110
  ocr_output=gr.JSON(label="识别结果")
111
  ocr_button.click(dd_ocr, inputs=ocr_input, outputs=ocr_output,api_name='dingding_ocr')
 
 
 
 
 
 
 
112
  demo.launch()
113
 
 
3
  import tempfile
4
  import requests
5
  import pandas as pd
6
+ from datatable import (dt, f,fread, by, ifelse, update, sort,count, min, max, mean, sum, rowsum,rowmean,rowcount,shift,cumsum,rbind,cbind,union)
7
  from TTS.utils.manage import ModelManager
8
  from TTS.utils.synthesizer import Synthesizer
9
  def fx(x:str):
 
59
  data={"image_url":sl,"type":dc[dt]}
60
  response=requests.post(url,json=data,headers=headers)
61
  return response.json()
62
+
63
+ def fx_dt(dc):
64
+ DT=fread(dc)
65
+ D_table=DT[:,{'销量和':cumsum(f.销量)}, by('月份')]
66
+ return D_table.to_pandas()
67
 
68
  demo=gr.Blocks()
69
  with demo:
 
100
  d_input=gr.Textbox(label="请填写需要datatable库处理的脚本",lines=18)
101
  d_output=gr.JSON(label="输出>")
102
  d_button=gr.Button("开始编译>>")
103
+ d_button.click(fx_datatable, inputs=d_input, outputs=d_output,api_name='pyexe')
104
 
105
  with gr.TabItem("钉钉群消息推送"):
106
  gr.Markdown("# 推送测试")
 
115
  ocr_button=gr.Button("开始识别>>")
116
  ocr_output=gr.JSON(label="识别结果")
117
  ocr_button.click(dd_ocr, inputs=ocr_input, outputs=ocr_output,api_name='dingding_ocr')
118
+
119
+ with gr.TabItem("datatable"):
120
+ gr.Markdown("# datatable测试")
121
+ dt_input=gr.File(label="选择需要读取的文档")
122
+ dt_output=gr.DataFrame(label="输出table")
123
+ dt_button=gr.Button("开始处理")
124
+ dt_button.click(fx_dt, inputs=dt_input, outputs=dt_output,api_name='datatable')
125
  demo.launch()
126