NSamson1 commited on
Commit
c27cd5b
·
verified ·
1 Parent(s): 3ebcac5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -12
app.py CHANGED
@@ -85,7 +85,7 @@ rag_chain = (
85
  | StrOutputParser()
86
  )
87
 
88
- # Define the Gradio interface with a sleek, professional theme
89
  def rag_memory_stream(message, history):
90
  partial_text = ""
91
  for new_text in rag_chain.stream(message):
@@ -104,17 +104,14 @@ description = (
104
  "No waiting in lines or long processes—just ask me and get immediate help! 🌟"
105
  )
106
 
107
- # Beautiful interface with an elegant theme and animations
108
- demo = gr.Interface(fn=rag_memory_stream,
109
- type="messages",
110
- title=title,
111
- description=description,
112
- fill_height=True,
113
- examples=examples,
114
- theme="huggingface",
115
- layout="vertical",
116
- live=True,
117
- css="body {background-color: #f8f8f8; font-family: 'Arial', sans-serif; font-size: 16px;} .gradio-container {border-radius: 15px; border: 2px solid #e1e1e1;} .gradio-header {font-weight: bold; color: #2a74f7;} .gradio-chat {background-color: #ffffff; border-radius: 12px; padding: 10px;} .gradio-button {background-color: #2a74f7; color: white; border-radius: 10px; border: none; padding: 12px 20px; transition: background-color 0.3s;} .gradio-button:hover {background-color: #1a55d1;} .gradio-footer {font-size: 12px; text-align: center; color: #777777;}")
118
 
119
  # Launch the app
120
  if __name__ == "__main__":
 
85
  | StrOutputParser()
86
  )
87
 
88
+ # Define the Gradio ChatInterface
89
  def rag_memory_stream(message, history):
90
  partial_text = ""
91
  for new_text in rag_chain.stream(message):
 
104
  "No waiting in lines or long processes—just ask me and get immediate help! 🌟"
105
  )
106
 
107
+ # Use ChatInterface for a chat-style UI
108
+ demo = gr.ChatInterface(
109
+ fn=rag_memory_stream,
110
+ title=title,
111
+ description=description,
112
+ examples=examples,
113
+ theme="glass",
114
+ )
 
 
 
115
 
116
  # Launch the app
117
  if __name__ == "__main__":