changxin commited on
Commit
4908003
·
1 Parent(s): d257b63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ def fx(x,y):
8
  m+=(pulp.lpDot(x,t)==y)
9
  m.solve()
10
  resu={'data':[x[i] for i in range(len(t)) if pulp.value(t[i])]}
11
- return json.dumps(resu, ensure_ascii=False)
12
 
13
  title = "测试WEB APP"
14
  description = """
@@ -19,4 +19,4 @@ description = """
19
  """
20
  article = "加入[组团吹水](https://qm.qq.com/cgi-bin/qm/qr?k=ueJ_sPuOGHOlzSsUC5lVTBdKpQP-PXbO&jump_from=webapi),你不来我不老!"
21
 
22
- gr.Interface(fn=fx,inputs=[gr.Textbox(placeholder='请输入凑数序列,如"1,3,5,10,16,54,32,48,6,7"',label="请输入待凑数序列",show_label=True),gr.number(label="请输入凑数和值",show_label=True)],outputs=gr.Textbox(label="输出运算结果",show_label=True),title = title, description = description, article = article).launch()
 
8
  m+=(pulp.lpDot(x,t)==y)
9
  m.solve()
10
  resu={'data':[x[i] for i in range(len(t)) if pulp.value(t[i])]}
11
+ return resu
12
 
13
  title = "测试WEB APP"
14
  description = """
 
19
  """
20
  article = "加入[组团吹水](https://qm.qq.com/cgi-bin/qm/qr?k=ueJ_sPuOGHOlzSsUC5lVTBdKpQP-PXbO&jump_from=webapi),你不来我不老!"
21
 
22
+ gr.Interface(fn=fx,inputs=[gr.Textbox(placeholder='请输入凑数序列,如"1,3,5,10,16,54,32,48,6,7"',label="请输入待凑数序列",show_label=True),gr.number(label="请输入凑数和值",show_label=True)],outputs=gr.JSON(label="输出运算结果",show_label=True),title = title, description = description, article = article).launch()