Update app.py
Browse files
app.py
CHANGED
@@ -85,7 +85,7 @@ rag_chain = (
|
|
85 |
| StrOutputParser()
|
86 |
)
|
87 |
|
88 |
-
# Define the Gradio
|
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 |
-
#
|
108 |
-
demo = gr.
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
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__":
|