Commit
Β·
8bd123f
1
Parent(s):
44ac5ee
Update UI
Browse files
app.py
CHANGED
@@ -377,7 +377,8 @@ select_and_prompt = RunnableLambda(lambda x:
|
|
377 |
answer_chain = (
|
378 |
prepare_answer_inputs
|
379 |
| select_and_prompt
|
380 |
-
|
|
|
381 |
)
|
382 |
|
383 |
def RExtract(pydantic_class: Type[BaseModel], llm, prompt):
|
@@ -472,46 +473,55 @@ def chat_interface(message, history, request: gr.Request):
|
|
472 |
if full_response:
|
473 |
update_knowledge_base(session_id, message, full_response)
|
474 |
|
475 |
-
|
476 |
-
|
477 |
-
|
|
|
|
|
478 |
margin: 0;
|
479 |
padding: 0;
|
|
|
480 |
}
|
481 |
-
.
|
482 |
-
width:
|
483 |
-
max-width: 1000px;
|
484 |
margin: 0 auto;
|
485 |
-
|
486 |
}
|
487 |
-
.
|
488 |
-
display:
|
489 |
-
flex-direction: column;
|
490 |
-
height: 95%;
|
491 |
-
overflow-y: auto;
|
492 |
}
|
493 |
-
.
|
494 |
-
|
495 |
-
overflow-y: auto;
|
496 |
-
min-height: 500px;
|
497 |
}
|
498 |
-
.
|
499 |
-
|
500 |
}
|
501 |
-
|
502 |
-
|
503 |
}
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
515 |
examples=[
|
516 |
"Give me an overview of Krishna Vamsi Dhulipalla's work experience across different roles?",
|
517 |
"What programming languages and tools does Krishna use for data science?",
|
|
|
377 |
answer_chain = (
|
378 |
prepare_answer_inputs
|
379 |
| select_and_prompt
|
380 |
+
#| relevance_llm
|
381 |
+
| answer_llm
|
382 |
)
|
383 |
|
384 |
def RExtract(pydantic_class: Type[BaseModel], llm, prompt):
|
|
|
473 |
if full_response:
|
474 |
update_knowledge_base(session_id, message, full_response)
|
475 |
|
476 |
+
demo = gr.ChatInterface(
|
477 |
+
fn=chat_interface,
|
478 |
+
title="π¬ Ask Krishna's AI Assistant",
|
479 |
+
css= """
|
480 |
+
html, body {
|
481 |
margin: 0;
|
482 |
padding: 0;
|
483 |
+
overflow-x: hidden; /* prevent horizontal scrollbars on body */
|
484 |
}
|
485 |
+
.column:nth-child(2) {
|
486 |
+
max-width: 800px;
|
|
|
487 |
margin: 0 auto;
|
488 |
+
width: 100%;
|
489 |
}
|
490 |
+
.float {
|
491 |
+
display: none;
|
|
|
|
|
|
|
492 |
}
|
493 |
+
.bubble-wrap {
|
494 |
+
background: #0f0f11 !important;
|
|
|
|
|
495 |
}
|
496 |
+
.gr-group {
|
497 |
+
border-radius: 2rem !important;
|
498 |
}
|
499 |
+
.flex {
|
500 |
+
border: none !important;
|
501 |
}
|
502 |
+
footer {
|
503 |
+
display: none !important;
|
504 |
+
}
|
505 |
+
::-webkit-scrollbar {
|
506 |
+
width: 1px;
|
507 |
+
height: 1px;
|
508 |
+
}
|
509 |
+
|
510 |
+
::-webkit-scrollbar-track {
|
511 |
+
background: transparent;
|
512 |
+
}
|
513 |
+
|
514 |
+
::-webkit-scrollbar-thumb {
|
515 |
+
background-color: rgba(255, 255, 255, 0.05); /* very light thumb */
|
516 |
+
border-radius: 10px;
|
517 |
+
}
|
518 |
+
|
519 |
+
/* Scrollbar - Firefox */
|
520 |
+
* {
|
521 |
+
scrollbar-width: thin;
|
522 |
+
scrollbar-color: rgba(255,255,255,0.05) transparent;
|
523 |
+
}
|
524 |
+
""",
|
525 |
examples=[
|
526 |
"Give me an overview of Krishna Vamsi Dhulipalla's work experience across different roles?",
|
527 |
"What programming languages and tools does Krishna use for data science?",
|