dayuian commited on
Commit
5b248ae
·
verified ·
1 Parent(s): 3e127d0

Update ui.py

Browse files
Files changed (1) hide show
  1. ui.py +4 -3
ui.py CHANGED
@@ -46,12 +46,13 @@ def create_ui():
46
  print(f"📢 [Debug] 模型: {model_name}")
47
  print(f"📢 [Debug] 輸入文本: {text}")
48
 
49
- result_display.update("🔄 AI 正在分析,請稍後...") # 🚀 讓 `result_display` 更新狀態
 
 
50
  result, _ = analyze_sentiment(text, model_name)
51
- result_display.update(result) # 🚀 讓 `result_display` 直接顯示 AI 分析結果
52
 
53
  print(f"📢 [Debug] 回傳結果: {result}")
54
- return result
55
 
56
  analyze_button.click(
57
  fn=process_analysis,
 
46
  print(f"📢 [Debug] 模型: {model_name}")
47
  print(f"📢 [Debug] 輸入文本: {text}")
48
 
49
+ processing_message = "🔄 **AI 正在分析,請稍後...**"
50
+ result_display.render(processing_message) # 🚀 顯示「分析中」
51
+
52
  result, _ = analyze_sentiment(text, model_name)
 
53
 
54
  print(f"📢 [Debug] 回傳結果: {result}")
55
+ return result # 🚀 直接回傳 Markdown 內容,Gradio 會自動更新 `Markdown`
56
 
57
  analyze_button.click(
58
  fn=process_analysis,