Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -378,15 +378,30 @@ def chat_interface(query_text):
|
|
378 |
|
379 |
|
380 |
# Define Gradio Interface
|
381 |
-
interface = gr.Interface(
|
382 |
-
fn=chat_interface,
|
383 |
-
inputs=gr.Textbox(lines=2, placeholder="Введите ваш вопрос здесь..."),
|
384 |
-
outputs=[gr.Textbox(), gr.Image()],
|
385 |
-
title="Чат с документами",
|
386 |
-
description="Задайте вопрос, и я отвечу на основе книги Павла Глобы Планетарная Лестница. "
|
387 |
-
"Для быстрого запроса трактовки планетарной лестницы используйте формат: PLadder DD-MM-YYYY HH:MM:SS место"
|
388 |
-
)
|
389 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
390 |
|
391 |
if __name__ == "__main__":
|
392 |
interface.launch()
|
|
|
378 |
|
379 |
|
380 |
# Define Gradio Interface
|
381 |
+
#interface = gr.Interface(
|
382 |
+
# fn=chat_interface,
|
383 |
+
# inputs=gr.Textbox(lines=2, placeholder="Введите ваш вопрос здесь..."),
|
384 |
+
# outputs=[gr.Textbox(), gr.Image()],
|
385 |
+
# title="Чат с документами",
|
386 |
+
# description="Задайте вопрос, и я отвечу на основе книги Павла Глобы Планетарная Лестница. "
|
387 |
+
# "Для быстрого запроса трактовки планетарной лестницы используйте формат: PLadder DD-MM-YYYY HH:MM:SS место"
|
388 |
+
#)
|
389 |
|
390 |
+
# UI layout with Gradio Blocks
|
391 |
+
with gr.Blocks() as interface:
|
392 |
+
with gr.Row():
|
393 |
+
with gr.Column(scale=2):
|
394 |
+
output_text = gr.Textbox(label="Response", lines=10)
|
395 |
+
with gr.Column(scale=1):
|
396 |
+
output_image = gr.Image(label="Planetary Ladder Plot")
|
397 |
+
with gr.Row():
|
398 |
+
query_text = gr.Textbox(label="Query", placeholder="e.g., PLadder 2023-10-10 12:00")
|
399 |
+
location_lat = gr.Textbox(label="Latitude", placeholder="e.g., 37.7749")
|
400 |
+
location_lon = gr.Textbox(label="Longitude", placeholder="e.g., -122.4194")
|
401 |
+
|
402 |
+
query_text.submit(chat_interface,
|
403 |
+
inputs=[query_text, location_lat, location_lon],
|
404 |
+
outputs=[output_text, output_image])
|
405 |
|
406 |
if __name__ == "__main__":
|
407 |
interface.launch()
|