devin_lee commited on
Commit
a4ab14d
·
1 Parent(s): 65ca539

update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -10
app.py CHANGED
@@ -53,15 +53,19 @@ def inference(message:str)->str:
53
 
54
  return result
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
- iface = gr.Interface(
58
- fn=inference,
59
- inputs=gr.Textbox(placeholder="請輸入顧客訊息...", label="輸入訊息"),
60
- outputs=gr.Textbox(label="分類結果"),
61
- title="訂位意圖分類器🍴🥂",
62
- description="判斷輸入訊息是否與訂位有關",
63
- layout="vertical"
64
- )
65
-
66
- iface.launch()
67
 
 
53
 
54
  return result
55
 
56
+ with gr.Block() as demo:
57
+ gr.Markdown("LLM訂位意圖分類器🍴🥂")
58
+ gr.Markdown("判斷輸入訊息是否與訂位有關")
59
+ with gr.Row():
60
+ inputs=gr.Textbox(placeholder="請輸入顧客訊息...", label="輸入訊息")
61
+ outputs=gr.Textbox(label="分類結果")
62
+ with gr.Row():
63
+ inference_btn = gr.Button("開始分類")
64
+ inference_btn.click(
65
+ fn=inference,
66
+ inputs=inputs,
67
+ outputs=outputs
68
+ )
69
 
70
+ demo.launch()
 
 
 
 
 
 
 
 
 
71