krishnadhulipalla commited on
Commit
8bd123f
Β·
1 Parent(s): 44ac5ee
Files changed (1) hide show
  1. app.py +42 -32
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
- | relevance_llm
 
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
- with gr.Blocks(css="""
476
- html, body, .gradio-container {
477
- height: 100%;
 
 
478
  margin: 0;
479
  padding: 0;
 
480
  }
481
- .gradio-container {
482
- width: 90%;
483
- max-width: 1000px;
484
  margin: 0 auto;
485
- padding: 1rem;
486
  }
487
- .chatbox-container {
488
- display: flex;
489
- flex-direction: column;
490
- height: 95%;
491
- overflow-y: auto;
492
  }
493
- .chatbot {
494
- flex: 1;
495
- overflow-y: auto;
496
- min-height: 500px;
497
  }
498
- .textbox {
499
- margin-top: 1rem;
500
  }
501
- #component-523 {
502
- height: 98%;
503
  }
504
- """) as demo:
505
- with gr.Column(elem_classes="chatbox-container"):
506
- gr.Markdown("## πŸ’¬ Ask Krishna's AI Assistant")
507
- gr.Markdown("πŸ’‘ Ask anything about Krishna Vamsi Dhulipalla")
508
- chatbot = gr.Chatbot(elem_classes="chatbot")
509
- textbox = gr.Textbox(placeholder="Ask a question about Krishna...", elem_classes="textbox")
510
-
511
- demo = gr.ChatInterface(
512
- fn=chat_interface,
513
- title="πŸ’¬ Ask Krishna's AI Assistant",
514
- description="πŸ’‘ Ask anything about Krishna Vamsi Dhulipalla",
 
 
 
 
 
 
 
 
 
 
 
 
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?",