Update app.py
Browse files
app.py
CHANGED
|
@@ -460,6 +460,15 @@ with gr.Blocks(title="π€ Dox the Data Professional's Guide π€"#,
|
|
| 460 |
# )
|
| 461 |
# example_buttons.append(btn)
|
| 462 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 463 |
gr.HTML(
|
| 464 |
"""
|
| 465 |
<hr>
|
|
@@ -487,30 +496,30 @@ with gr.Blocks(title="π€ Dox the Data Professional's Guide π€"#,
|
|
| 487 |
elem_id="question_box"
|
| 488 |
)
|
| 489 |
|
| 490 |
-
with gr.Row():
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
|
| 497 |
with gr.Row():
|
| 498 |
ask_btn = gr.Button("Submit π€", variant="primary", elem_classes="primary-action")
|
| 499 |
clear_btn = gr.Button("π§Ή Clear Chat", elem_classes="clear-action")
|
| 500 |
# A section for example questions.
|
| 501 |
-
gr.Markdown("### π‘ Example Questions", elem_classes="
|
| 502 |
-
examples = gr.Examples(
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
)
|
| 509 |
|
| 510 |
# ππ Feedback buttons
|
| 511 |
with gr.Row():
|
| 512 |
-
thumbs_up = gr.Button("π Helpful", elem_classes="
|
| 513 |
-
thumbs_down = gr.Button("π Not Helpful", elem_classes="
|
| 514 |
|
| 515 |
# Hidden feedback box (only appears on π)
|
| 516 |
feedback_box = gr.Textbox(
|
|
@@ -518,16 +527,16 @@ with gr.Blocks(title="π€ Dox the Data Professional's Guide π€"#,
|
|
| 518 |
visible=False
|
| 519 |
)
|
| 520 |
|
| 521 |
-
submit_feedback_btn = gr.Button("π Submit Feedback", visible=False, elem_classes="
|
| 522 |
-
feedback_status = gr.Markdown("", elem_classes="
|
| 523 |
# RIGHT-SIDE COLUMN: for the PDF preview.
|
| 524 |
with gr.Column(scale=3):
|
| 525 |
-
gr.Markdown("### π Referenced PDF Document (π Empty for Web Results)", elem_classes="
|
| 526 |
#gr.Markdown(" π Empty by default", elem_classes="component")
|
| 527 |
# A hidden state to store the PDF link found in the agent's response.
|
| 528 |
link_state = gr.State()
|
| 529 |
# A markdown component to show PDF loading status.
|
| 530 |
-
pdf_status = gr.Markdown(visible=False, elem_classes="
|
| 531 |
# An image component to display the PDF preview.
|
| 532 |
output_image = gr.Image(
|
| 533 |
label="β¬οΈ Cheat Sheet Preview",
|
|
|
|
| 460 |
# )
|
| 461 |
# example_buttons.append(btn)
|
| 462 |
|
| 463 |
+
gr.Markdown("### π‘ Example Questions", elem_classes="example-button")
|
| 464 |
+
examples = gr.Examples(
|
| 465 |
+
examples=example_questions,
|
| 466 |
+
inputs=question,
|
| 467 |
+
outputs=[chatbot, question],
|
| 468 |
+
fn=run_example,
|
| 469 |
+
cache_examples=False
|
| 470 |
+
)
|
| 471 |
+
|
| 472 |
gr.HTML(
|
| 473 |
"""
|
| 474 |
<hr>
|
|
|
|
| 496 |
elem_id="question_box"
|
| 497 |
)
|
| 498 |
|
| 499 |
+
# with gr.Row():
|
| 500 |
+
# submit_btn = gr.Button(
|
| 501 |
+
# "π Ask Dox a question:",
|
| 502 |
+
# variant="primary",
|
| 503 |
+
# elem_classes=["primary-action"]
|
| 504 |
+
# )
|
| 505 |
|
| 506 |
with gr.Row():
|
| 507 |
ask_btn = gr.Button("Submit π€", variant="primary", elem_classes="primary-action")
|
| 508 |
clear_btn = gr.Button("π§Ή Clear Chat", elem_classes="clear-action")
|
| 509 |
# A section for example questions.
|
| 510 |
+
# gr.Markdown("### π‘ Example Questions", elem_classes="example-button")
|
| 511 |
+
# examples = gr.Examples(
|
| 512 |
+
# examples=example_questions,
|
| 513 |
+
# inputs=question,
|
| 514 |
+
# outputs=[chatbot, question],
|
| 515 |
+
# fn=run_example,
|
| 516 |
+
# cache_examples=False
|
| 517 |
+
# )
|
| 518 |
|
| 519 |
# ππ Feedback buttons
|
| 520 |
with gr.Row():
|
| 521 |
+
thumbs_up = gr.Button("π Helpful", elem_classes="clear-action")
|
| 522 |
+
thumbs_down = gr.Button("π Not Helpful", elem_classes="clear-action")
|
| 523 |
|
| 524 |
# Hidden feedback box (only appears on π)
|
| 525 |
feedback_box = gr.Textbox(
|
|
|
|
| 527 |
visible=False
|
| 528 |
)
|
| 529 |
|
| 530 |
+
submit_feedback_btn = gr.Button("π Submit Feedback", visible=False, elem_classes="clear-action")
|
| 531 |
+
feedback_status = gr.Markdown("", elem_classes="clear-action")
|
| 532 |
# RIGHT-SIDE COLUMN: for the PDF preview.
|
| 533 |
with gr.Column(scale=3):
|
| 534 |
+
gr.Markdown("### π Referenced PDF Document (π Empty for Web Results)", elem_classes="clear-action")
|
| 535 |
#gr.Markdown(" π Empty by default", elem_classes="component")
|
| 536 |
# A hidden state to store the PDF link found in the agent's response.
|
| 537 |
link_state = gr.State()
|
| 538 |
# A markdown component to show PDF loading status.
|
| 539 |
+
pdf_status = gr.Markdown(visible=False, elem_classes="clear-action")
|
| 540 |
# An image component to display the PDF preview.
|
| 541 |
output_image = gr.Image(
|
| 542 |
label="β¬οΈ Cheat Sheet Preview",
|