UKURIKIYEYEZU commited on
Commit
a78fdc5
·
verified ·
1 Parent(s): 30aa3db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -9
app.py CHANGED
@@ -366,11 +366,11 @@ class UserSession:
366
  self.set_welcome_message(user_info.get("Nickname", "Guest"))
367
  # Initialize conversation history with welcome message
368
  welcome = self.get_welcome_message()
369
- initial_message = (" "
370
- )
371
  self.conversation_history = [
372
  {"role": "assistant", "content": welcome},
373
- {"role": "assistant", "content": initial_message}
374
  ]
375
 
376
  def get_user(self):
@@ -433,9 +433,9 @@ def collect_user_info(Nickname):
433
 
434
  # Add initial message to start the conversation
435
  def add_initial_message(chatbot):
436
- initial_message = (" "
437
- )
438
- return chatbot + [(None, initial_message)]
439
 
440
  # Create RAG chain with user context and conversation history
441
  def create_rag_chain(retriever, template, api_key):
@@ -578,13 +578,26 @@ def chatbot_interface():
578
  color: var(--text) !important;
579
  margin-bottom: 1rem !important;
580
  }
 
 
 
 
 
 
 
 
581
 
582
 
583
  """) as demo:
584
  # User registration section
585
  registration_container = gr.Column(visible=True)
 
 
586
  with registration_container:
587
- gr.Markdown("### Your privacy is our concern, please provide your nickname. ")
 
 
 
588
 
589
  with gr.Row():
590
  first_name = gr.Textbox(
@@ -600,11 +613,18 @@ def chatbot_interface():
600
 
601
  # Chatbot section (initially hidden)
602
  chatbot_container = gr.Column(visible=False)
603
- with chatbot_container:
 
 
 
 
 
 
604
  chat_interface = gr.ChatInterface(
605
  fn=rag_memory_stream,
606
  title="Chat with GBVR",
607
- fill_height=True
 
608
  )
609
 
610
  # Footer with version info
 
366
  self.set_welcome_message(user_info.get("Nickname", "Guest"))
367
  # Initialize conversation history with welcome message
368
  welcome = self.get_welcome_message()
369
+ #initial_message = (" "
370
+ #)
371
  self.conversation_history = [
372
  {"role": "assistant", "content": welcome},
373
+ #{"role": "assistant", "content": initial_message}
374
  ]
375
 
376
  def get_user(self):
 
433
 
434
  # Add initial message to start the conversation
435
  def add_initial_message(chatbot):
436
+ #initial_message = (" "
437
+ # )
438
+ return chatbot #+ [(None, initial_message)]
439
 
440
  # Create RAG chain with user context and conversation history
441
  def create_rag_chain(retriever, template, api_key):
 
578
  color: var(--text) !important;
579
  margin-bottom: 1rem !important;
580
  }
581
+
582
+ .registration-markdown {
583
+ color: white !important;
584
+ }
585
+
586
+ .chat-title h1 {
587
+ color: white !important;
588
+ }
589
 
590
 
591
  """) as demo:
592
  # User registration section
593
  registration_container = gr.Column(visible=True)
594
+ # with registration_container:
595
+ # gr.Markdown("### Your privacy is our concern, please provide your nickname. ")
596
  with registration_container:
597
+ gr.Markdown(
598
+ "### Your privacy is our concern, please provide your nickname.",
599
+ elem_id="registration-markdown"
600
+ )
601
 
602
  with gr.Row():
603
  first_name = gr.Textbox(
 
613
 
614
  # Chatbot section (initially hidden)
615
  chatbot_container = gr.Column(visible=False)
616
+ # with chatbot_container:
617
+ # chat_interface = gr.ChatInterface(
618
+ # fn=rag_memory_stream,
619
+ # title="Chat with GBVR",
620
+ # fill_height=True
621
+ # )
622
+ with chatbot_container:
623
  chat_interface = gr.ChatInterface(
624
  fn=rag_memory_stream,
625
  title="Chat with GBVR",
626
+ fill_height=True,
627
+ elem_id="chat-title"
628
  )
629
 
630
  # Footer with version info