Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,9 +20,10 @@ def call_company(p):
|
|
20 |
return response.output.text
|
21 |
|
22 |
|
23 |
-
def run_flow(
|
24 |
-
|
25 |
-
|
|
|
26 |
else:
|
27 |
pass
|
28 |
|
@@ -32,11 +33,12 @@ with gr.Blocks() as demo:
|
|
32 |
with gr.Column():
|
33 |
scene = gr.Dropdown(
|
34 |
["公司净调", ], label="场景", info="请选择场景"
|
35 |
-
)
|
36 |
text = gr.Textbox(label="输入")
|
37 |
btn = gr.Button("开始")
|
38 |
with gr.Column():
|
39 |
-
result = gr.
|
40 |
-
|
|
|
41 |
|
42 |
demo.launch()
|
|
|
20 |
return response.output.text
|
21 |
|
22 |
|
23 |
+
def run_flow(scene, text):
|
24 |
+
print(scene, text)
|
25 |
+
if scene == "公司净调":
|
26 |
+
return call_company(text)
|
27 |
else:
|
28 |
pass
|
29 |
|
|
|
33 |
with gr.Column():
|
34 |
scene = gr.Dropdown(
|
35 |
["公司净调", ], label="场景", info="请选择场景"
|
36 |
+
)
|
37 |
text = gr.Textbox(label="输入")
|
38 |
btn = gr.Button("开始")
|
39 |
with gr.Column():
|
40 |
+
result = gr.Markdown(label="结果", show_label=True, container=True, min_height=100)
|
41 |
+
|
42 |
+
btn.click(fn=run_flow, inputs=[scene, text], outputs=result)
|
43 |
|
44 |
demo.launch()
|