Seunggg commited on
Commit
547332f
·
verified ·
1 Parent(s): 47cf770

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -70,12 +70,14 @@ def respond(user_input):
70
  return sensor_display, answer
71
 
72
  # Gradio 界面
73
- with gr.Blocks() as demo:
74
- sensor_box = gr.Textbox(label="🧪 当前传感器数据", lines=6, interactive=False, value=get_sensor_data())
75
-
76
- def auto_refresh():
77
- return get_sensor_data()
78
-
79
- sensor_box.change(fn=auto_refresh, inputs=None, outputs=sensor_box).every(5)
 
 
80
 
81
  demo.launch()
 
70
  return sensor_display, answer
71
 
72
  # Gradio 界面
73
+ gr.Interface(
74
+ fn=respond,
75
+ inputs=gr.Textbox(lines=4, label="植物问题"),
76
+ outputs=[
77
+ gr.Textbox(label="🧪 当前传感器数据", lines=6, interactive=False),
78
+ gr.Textbox(label="🤖 回答建议", lines=8, interactive=False)
79
+ ],
80
+ title="🌱 植物助手 - 实时联动版",
81
+ description="结合 Render 实时传感器数据 + 本地 LoRA 模型,生成更合理建议。
82
 
83
  demo.launch()