Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
from peft import PeftModel
|
4 |
import torch
|
|
|
5 |
|
6 |
model_id = "deepseek-ai/deepseek-coder-1.3b-base"
|
7 |
lora_id = "Seunggg/lora-plant"
|
@@ -62,10 +63,13 @@ def respond(user_input, sensor_data_input):
|
|
62 |
# Gradio 界面
|
63 |
gr.Interface(
|
64 |
fn=respond,
|
65 |
-
inputs=
|
|
|
|
|
|
|
66 |
outputs="text",
|
67 |
-
title="🌱 植物助手 LoRA
|
68 |
-
description="
|
69 |
-
allow_flagging="never"
|
70 |
).launch()
|
71 |
|
|
|
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
from peft import PeftModel
|
4 |
import torch
|
5 |
+
import gradio as gr
|
6 |
|
7 |
model_id = "deepseek-ai/deepseek-coder-1.3b-base"
|
8 |
lora_id = "Seunggg/lora-plant"
|
|
|
63 |
# Gradio 界面
|
64 |
gr.Interface(
|
65 |
fn=respond,
|
66 |
+
inputs=[
|
67 |
+
gr.Textbox(lines=4, label="植物问题"),
|
68 |
+
gr.Textbox(lines=2, label="传感器数据 (JSON 格式)", placeholder='{"temperature": 25, "humidity": 60}')
|
69 |
+
],
|
70 |
outputs="text",
|
71 |
+
title="🌱 植物助手 - 本地 LoRA + Render 联动版",
|
72 |
+
description="结合本地建议和传感器分析结果。"
|
|
|
73 |
).launch()
|
74 |
|
75 |
+
|