Update app.py
Browse files
app.py
CHANGED
@@ -96,7 +96,6 @@ def predict(message, history):
|
|
96 |
response = handle_query(message)
|
97 |
response_with_logo = f'<div class="response-with-logo">{logo_html}<div class="response-text">{response}</div></div>'
|
98 |
return response_with_logo
|
99 |
-
"""
|
100 |
# Custom CSS for styling
|
101 |
css = '''
|
102 |
.gradio-container {
|
@@ -106,10 +105,7 @@ css = '''
|
|
106 |
max-width: 450px;
|
107 |
margin: 0 auto;
|
108 |
padding: 20px;
|
109 |
-
border: 1px solid #ddd;
|
110 |
-
border-radius: 10px;
|
111 |
background-color: #fff;
|
112 |
-
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
113 |
height: 100%;
|
114 |
max-height: 600px;
|
115 |
}
|
@@ -141,8 +137,6 @@ css = '''
|
|
141 |
vertical-align: middle;
|
142 |
font-size: 16px;
|
143 |
background-color: #fff;
|
144 |
-
border: 1px solid #ced4da;
|
145 |
-
border-radius: 15px 15px 15px 0;
|
146 |
padding: 10px;
|
147 |
max-width: 80%;
|
148 |
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
@@ -151,9 +145,7 @@ css = '''
|
|
151 |
flex: 1;
|
152 |
overflow-y: auto;
|
153 |
padding: 15px;
|
154 |
-
border-bottom: 1px solid #ddd;
|
155 |
background-color: #f9f9f9;
|
156 |
-
border-radius: 5px;
|
157 |
margin-bottom: 10px;
|
158 |
max-height: 500px;
|
159 |
}
|
@@ -165,8 +157,6 @@ css = '''
|
|
165 |
.gradio-message.user .gradio-message-content {
|
166 |
background-color: #E1FFC7;
|
167 |
align-self: flex-end;
|
168 |
-
border: 1px solid #c3e6cb;
|
169 |
-
border-radius: 15px 15px 0 15px;
|
170 |
padding: 10px;
|
171 |
font-size: 16px;
|
172 |
margin-bottom: 5px;
|
@@ -175,8 +165,6 @@ css = '''
|
|
175 |
.gradio-message.bot .gradio-message-content {
|
176 |
background-color: #fff;
|
177 |
align-self: flex-start;
|
178 |
-
border: 1px solid #ced4da;
|
179 |
-
border-radius: 15px 15px 15px 0;
|
180 |
padding: 10px;
|
181 |
font-size: 16px;
|
182 |
margin-bottom: 5px;
|
@@ -199,6 +187,7 @@ css = '''
|
|
199 |
content: none;
|
200 |
}
|
201 |
'''
|
|
|
202 |
|
203 |
logo_html = '''
|
204 |
<div class="gradio-logo">
|
@@ -217,6 +206,7 @@ demo.launch()
|
|
217 |
"""
|
218 |
gr.ChatInterface(predict,
|
219 |
title="FernAi_chatBot",
|
|
|
220 |
description="Ask any Redfernstech any questions",
|
221 |
clear_btn=None, undo_btn=None, retry_btn=None,
|
222 |
examples=['Tell me about Redfernstech?', 'Services in Redfernstech?']
|
|
|
96 |
response = handle_query(message)
|
97 |
response_with_logo = f'<div class="response-with-logo">{logo_html}<div class="response-text">{response}</div></div>'
|
98 |
return response_with_logo
|
|
|
99 |
# Custom CSS for styling
|
100 |
css = '''
|
101 |
.gradio-container {
|
|
|
105 |
max-width: 450px;
|
106 |
margin: 0 auto;
|
107 |
padding: 20px;
|
|
|
|
|
108 |
background-color: #fff;
|
|
|
109 |
height: 100%;
|
110 |
max-height: 600px;
|
111 |
}
|
|
|
137 |
vertical-align: middle;
|
138 |
font-size: 16px;
|
139 |
background-color: #fff;
|
|
|
|
|
140 |
padding: 10px;
|
141 |
max-width: 80%;
|
142 |
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
|
145 |
flex: 1;
|
146 |
overflow-y: auto;
|
147 |
padding: 15px;
|
|
|
148 |
background-color: #f9f9f9;
|
|
|
149 |
margin-bottom: 10px;
|
150 |
max-height: 500px;
|
151 |
}
|
|
|
157 |
.gradio-message.user .gradio-message-content {
|
158 |
background-color: #E1FFC7;
|
159 |
align-self: flex-end;
|
|
|
|
|
160 |
padding: 10px;
|
161 |
font-size: 16px;
|
162 |
margin-bottom: 5px;
|
|
|
165 |
.gradio-message.bot .gradio-message-content {
|
166 |
background-color: #fff;
|
167 |
align-self: flex-start;
|
|
|
|
|
168 |
padding: 10px;
|
169 |
font-size: 16px;
|
170 |
margin-bottom: 5px;
|
|
|
187 |
content: none;
|
188 |
}
|
189 |
'''
|
190 |
+
"""
|
191 |
|
192 |
logo_html = '''
|
193 |
<div class="gradio-logo">
|
|
|
206 |
"""
|
207 |
gr.ChatInterface(predict,
|
208 |
title="FernAi_chatBot",
|
209 |
+
css=css,
|
210 |
description="Ask any Redfernstech any questions",
|
211 |
clear_btn=None, undo_btn=None, retry_btn=None,
|
212 |
examples=['Tell me about Redfernstech?', 'Services in Redfernstech?']
|