Turtle1106 commited on
Commit
bf7094d
·
verified ·
1 Parent(s): 48f14ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -58,13 +58,22 @@ def compare_models(prompt):
58
 
59
  # --- 4. 建立介面 ---
60
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
61
- gr.Markdown("#SFT Demo)")
62
- gr.Markdown("展示 原始模型與微調後模型針對同一問題的回答差異。")
63
 
64
  with gr.Row():
65
- input_box = gr.Textbox(label="輸入測試問題", placeholder="例如:請推薦台灣的旅遊景點。", lines=2)
66
  submit_btn = gr.Button("開始比對", variant="primary")
67
 
 
 
 
 
 
 
 
 
 
68
  submit_btn.click(compare_models, inputs=input_box, outputs=[output_base, output_chat])
69
 
70
  # 啟動
 
58
 
59
  # --- 4. 建立介面 ---
60
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
61
+ gr.Markdown("#SFT Demo")
62
+ gr.Markdown("展示原始模型與微調後模型 針對同一問題的回答差異。")
63
 
64
  with gr.Row():
65
+ input_box = gr.Textbox(label="輸入測試問題 (Prompt)", placeholder="例如:請推薦台灣的旅遊景點。", lines=2)
66
  submit_btn = gr.Button("開始比對", variant="primary")
67
 
68
+ with gr.Row():
69
+ with gr.Column():
70
+ output_base = gr.Textbox(label="❌ 訓練前 (Base Model)", lines=10, interactive=False)
71
+ gr.Markdown("*特徵:容易答非所問、不斷重複問題、或像機器人一樣講廢話。*")
72
+
73
+ with gr.Column():
74
+ output_chat = gr.Textbox(label="✅ 訓練後 (SFT Model)", lines=10, interactive=False)
75
+ gr.Markdown("*特徵:能理解指令、條理分明、回答符合人類邏輯。*")
76
+
77
  submit_btn.click(compare_models, inputs=input_box, outputs=[output_base, output_chat])
78
 
79
  # 啟動