Update app.py
Browse files
app.py
CHANGED
|
@@ -433,12 +433,6 @@ with gr.Blocks(css="""
|
|
| 433 |
margin-top: 6px;
|
| 434 |
min-height: 8em;
|
| 435 |
}
|
| 436 |
-
|
| 437 |
-
#waskie_kontener {
|
| 438 |
-
max-width: 750px;
|
| 439 |
-
margin: 0 auto;
|
| 440 |
-
}
|
| 441 |
-
|
| 442 |
""") as gui:
|
| 443 |
|
| 444 |
session_dir = gr.State(value=init_user_session)
|
|
@@ -450,20 +444,14 @@ with gr.Blocks(css="""
|
|
| 450 |
|
| 451 |
with gr.Tabs():
|
| 452 |
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
with gr.Column(elem_id="waskie_kontener"):
|
| 456 |
-
gr.Markdown("# Asystent Finansowy")
|
| 457 |
-
gr.Markdown("### Odpowiadam na pytania z zakresu ETF-贸w notowanych na GPW.")
|
| 458 |
-
gr.Markdown("###### Pami臋taj: jestem tylko chatbotem...")
|
| 459 |
-
|
| 460 |
chatbot = gr.Chatbot()
|
| 461 |
input_text_chat = gr.Textbox(placeholder="Napisz tutaj pytanie...", container=False, autoscroll=True, scale=7)
|
| 462 |
input_text_chat.submit(fn=stream_response, inputs=[input_text_chat, chatbot], outputs=[chatbot, input_text_chat])
|
| 463 |
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
with gr.Column(elem_id="waskie_kontener"): # te偶 w tym samym kontenerze
|
| 467 |
input_text_form = gr.Textbox(label="Zadaj pytanie:", placeholder="Napisz tutaj pytanie...", lines=2, interactive=True)
|
| 468 |
|
| 469 |
with gr.Row():
|
|
@@ -481,6 +469,7 @@ with gr.Blocks(css="""
|
|
| 481 |
)
|
| 482 |
|
| 483 |
output_cytaty = gr.State("")
|
|
|
|
| 484 |
with gr.Row():
|
| 485 |
with gr.Column(scale=1):
|
| 486 |
zacytuj_button = gr.Button("Przytocz 藕r贸d艂a")
|
|
@@ -493,7 +482,6 @@ with gr.Blocks(css="""
|
|
| 493 |
gr.Markdown("### Pobierz odpowiedzi:")
|
| 494 |
download_files = gr.File(label="Pliki do pobrania", interactive=False, file_types=[".docx"])
|
| 495 |
|
| 496 |
-
|
| 497 |
# Logika przycisk贸w
|
| 498 |
submit_button.click(
|
| 499 |
response,
|
|
|
|
| 433 |
margin-top: 6px;
|
| 434 |
min-height: 8em;
|
| 435 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 436 |
""") as gui:
|
| 437 |
|
| 438 |
session_dir = gr.State(value=init_user_session)
|
|
|
|
| 444 |
|
| 445 |
with gr.Tabs():
|
| 446 |
|
| 447 |
+
# ChatBot
|
| 448 |
+
with gr.TabItem("馃挰 Chat"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 449 |
chatbot = gr.Chatbot()
|
| 450 |
input_text_chat = gr.Textbox(placeholder="Napisz tutaj pytanie...", container=False, autoscroll=True, scale=7)
|
| 451 |
input_text_chat.submit(fn=stream_response, inputs=[input_text_chat, chatbot], outputs=[chatbot, input_text_chat])
|
| 452 |
|
| 453 |
+
# Formularz
|
| 454 |
+
with gr.TabItem("馃摑 Formularz"):
|
|
|
|
| 455 |
input_text_form = gr.Textbox(label="Zadaj pytanie:", placeholder="Napisz tutaj pytanie...", lines=2, interactive=True)
|
| 456 |
|
| 457 |
with gr.Row():
|
|
|
|
| 469 |
)
|
| 470 |
|
| 471 |
output_cytaty = gr.State("")
|
| 472 |
+
|
| 473 |
with gr.Row():
|
| 474 |
with gr.Column(scale=1):
|
| 475 |
zacytuj_button = gr.Button("Przytocz 藕r贸d艂a")
|
|
|
|
| 482 |
gr.Markdown("### Pobierz odpowiedzi:")
|
| 483 |
download_files = gr.File(label="Pliki do pobrania", interactive=False, file_types=[".docx"])
|
| 484 |
|
|
|
|
| 485 |
# Logika przycisk贸w
|
| 486 |
submit_button.click(
|
| 487 |
response,
|