Spaces:
Sleeping
Sleeping
Update ui.py
Browse files
ui.py
CHANGED
|
@@ -43,6 +43,26 @@ def create_ui(prediction_handler, chatbot_handler, api_handlers: dict):
|
|
| 43 |
label="관측소 선택",
|
| 44 |
value="DT_0001"
|
| 45 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
# 3. API 탭
|
| 48 |
with gr.TabItem("🔌 API"):
|
|
@@ -172,23 +192,4 @@ def create_ui(prediction_handler, chatbot_handler, api_handlers: dict):
|
|
| 172 |
api_name="predict"
|
| 173 |
)
|
| 174 |
|
| 175 |
-
return demo
|
| 176 |
-
input_csv = gr.File(label="과거 데이터 업로드 (.csv)")
|
| 177 |
-
predict_btn = gr.Button("🚀 예측 실행", variant="primary")
|
| 178 |
-
|
| 179 |
-
with gr.Column(scale=3):
|
| 180 |
-
output_plot = gr.Plot(label="예측 결과 시각화")
|
| 181 |
-
output_df = gr.DataFrame(label="예측 결과 데이터")
|
| 182 |
-
|
| 183 |
-
output_log = gr.Textbox(label="실행 로그", lines=5, interactive=False)
|
| 184 |
-
|
| 185 |
-
# 2. 챗봇 탭
|
| 186 |
-
with gr.TabItem("💬 AI 조위 챗봇"):
|
| 187 |
-
gr.ChatInterface(
|
| 188 |
-
fn=chatbot_handler,
|
| 189 |
-
title="",
|
| 190 |
-
description="조위에 대해 궁금한 점을 물어보세요.",
|
| 191 |
-
# examples=[
|
| 192 |
-
# "인천 현재 조위 알려줘",
|
| 193 |
-
# "오늘 만조 시간은?"
|
| 194 |
-
# ]
|
|
|
|
| 43 |
label="관측소 선택",
|
| 44 |
value="DT_0001"
|
| 45 |
)
|
| 46 |
+
input_csv = gr.File(label="과거 데이터 업로드 (.csv)")
|
| 47 |
+
predict_btn = gr.Button("🚀 예측 실행", variant="primary")
|
| 48 |
+
|
| 49 |
+
with gr.Column(scale=3):
|
| 50 |
+
output_plot = gr.Plot(label="예측 결과 시각화")
|
| 51 |
+
output_df = gr.DataFrame(label="예측 결과 데이터")
|
| 52 |
+
|
| 53 |
+
output_log = gr.Textbox(label="실행 로그", lines=5, interactive=False)
|
| 54 |
+
|
| 55 |
+
# 2. 챗봇 탭
|
| 56 |
+
with gr.TabItem("💬 AI 조위 챗봇"):
|
| 57 |
+
gr.ChatInterface(
|
| 58 |
+
fn=chatbot_handler,
|
| 59 |
+
title="",
|
| 60 |
+
description="조위에 대해 궁금한 점을 물어보세요.",
|
| 61 |
+
# examples=[
|
| 62 |
+
# "인천 현재 조위 알려줘",
|
| 63 |
+
# "오늘 만조 시간은?"
|
| 64 |
+
# ]
|
| 65 |
+
)
|
| 66 |
|
| 67 |
# 3. API 탭
|
| 68 |
with gr.TabItem("🔌 API"):
|
|
|
|
| 192 |
api_name="predict"
|
| 193 |
)
|
| 194 |
|
| 195 |
+
return demo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|