Commit
·
8a3a868
1
Parent(s):
5757dad
gradio update
Browse files
app.py
CHANGED
|
@@ -494,21 +494,57 @@ def chat_interface(message, history):
|
|
| 494 |
"query": message,
|
| 495 |
"answer": full_response
|
| 496 |
})
|
| 497 |
-
|
| 498 |
-
demo = gr.ChatInterface(
|
| 499 |
-
fn=chat_interface,
|
| 500 |
-
title="💬 Ask Krishna's AI Assistant",
|
| 501 |
-
description="💡 Ask anything about Krishna Vamsi Dhulipalla",
|
| 502 |
-
# examples=[
|
| 503 |
-
# "What are Krishna's research interests?",
|
| 504 |
-
# "Where did Krishna work?",
|
| 505 |
-
# "What did he study at Virginia Tech?"
|
| 506 |
-
# ],
|
| 507 |
-
theme="default"
|
| 508 |
-
)
|
| 509 |
|
| 510 |
-
|
| 511 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 512 |
|
| 513 |
# with gr.Blocks(css="""
|
| 514 |
# html, body, .gradio-container {
|
|
|
|
| 494 |
"query": message,
|
| 495 |
"answer": full_response
|
| 496 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 497 |
|
| 498 |
+
with gr.Blocks(css="""
|
| 499 |
+
html, body, .gradio-container {
|
| 500 |
+
height: 100%;
|
| 501 |
+
margin: 0;
|
| 502 |
+
padding: 0;
|
| 503 |
+
}
|
| 504 |
+
.gradio-container {
|
| 505 |
+
width: 90%;
|
| 506 |
+
max-width: 1000px;
|
| 507 |
+
margin: 0 auto;
|
| 508 |
+
padding: 1rem;
|
| 509 |
+
}
|
| 510 |
+
|
| 511 |
+
.chatbox-container {
|
| 512 |
+
display: flex;
|
| 513 |
+
flex-direction: column;
|
| 514 |
+
height: 95%;
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
.chatbot {
|
| 518 |
+
flex: 1;
|
| 519 |
+
overflow-y: auto;
|
| 520 |
+
min-height: 500px;
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
.textbox {
|
| 524 |
+
margin-top: 1rem;
|
| 525 |
+
}
|
| 526 |
+
#component-523 {
|
| 527 |
+
height: 98%;
|
| 528 |
+
}
|
| 529 |
+
""") as demo:
|
| 530 |
+
with gr.Column(elem_classes="chatbox-container"):
|
| 531 |
+
gr.Markdown("## 💬 Ask Krishna's AI Assistant")
|
| 532 |
+
gr.Markdown("💡 Ask anything about Krishna Vamsi Dhulipalla")
|
| 533 |
+
chatbot = gr.Chatbot(elem_classes="chatbot")
|
| 534 |
+
textbox = gr.Textbox(placeholder="Ask a question about Krishna...", elem_classes="textbox")
|
| 535 |
+
|
| 536 |
+
gr.ChatInterface(
|
| 537 |
+
fn=chat_interface,
|
| 538 |
+
chatbot=chatbot,
|
| 539 |
+
textbox=textbox,
|
| 540 |
+
examples=[
|
| 541 |
+
"What are Krishna's research interests?",
|
| 542 |
+
"Where did Krishna work?",
|
| 543 |
+
"What did he study at Virginia Tech?"
|
| 544 |
+
],
|
| 545 |
+
)
|
| 546 |
+
|
| 547 |
+
demo.launch(max_threads=4, prevent_thread_lock=True, debug=True)
|
| 548 |
|
| 549 |
# with gr.Blocks(css="""
|
| 550 |
# html, body, .gradio-container {
|