Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
title = "测试WEB APP"
|
6 |
description = """
|
|
|
1 |
import gradio as gr
|
2 |
+
import json,pulp
|
3 |
+
def fx(x,y):
|
4 |
+
m=pulp.LpProblem()
|
5 |
+
x=list(map(int,x.split(',')))
|
6 |
+
t=[pulp.LpVariable('t'+str(i),cat=pulp.LpBinary) for i in range(len(x))]
|
7 |
+
m+=pulp.lpDot(x,t)
|
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 = """
|