Update app.py
Browse files
app.py
CHANGED
@@ -98,56 +98,33 @@ def predict(message, history):
|
|
98 |
return response_with_logo
|
99 |
# Custom CSS for styling
|
100 |
css = '''
|
101 |
-
.gradio-logo {
|
102 |
-
text-align: center;
|
103 |
-
margin-bottom: 20px;
|
104 |
-
}
|
105 |
.circle-logo {
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
background-color: #F8D7DA;
|
127 |
-
}
|
128 |
|
129 |
'''
|
130 |
-
"""
|
131 |
-
|
132 |
-
logo_html = '''
|
133 |
-
<div class="gradio-logo">
|
134 |
-
<img src="https://i.ibb.co/xfWKwkG/Screenshot-2024-07-08-032131.png" alt="FernAi" style="display: block; margin: 0 auto; width: 100px; height: 100px;">
|
135 |
-
</div>
|
136 |
-
'''
|
137 |
-
|
138 |
-
# Create the Blocks layout with the custom HTML and ChatInterface
|
139 |
-
with gr.Blocks(theme=gr.themes.Monochrome(), fill_height=True, css=css) as demo:
|
140 |
-
with gr.Column():
|
141 |
-
gr.HTML(logo_html)
|
142 |
-
gr.ChatInterface(predict, clear_btn=None, undo_btn=None, retry_btn=None)
|
143 |
-
|
144 |
-
# Launch the interface
|
145 |
-
demo.launch()
|
146 |
-
"""
|
147 |
gr.ChatInterface(predict,
|
148 |
title="FernAi_chatBot",
|
149 |
css=css,
|
150 |
description="Ask any Redfernstech any questions",
|
151 |
clear_btn=None, undo_btn=None, retry_btn=None,
|
152 |
examples=['Tell me about Redfernstech?', 'Services in Redfernstech?']
|
153 |
-
).launch()
|
|
|
98 |
return response_with_logo
|
99 |
# Custom CSS for styling
|
100 |
css = '''
|
|
|
|
|
|
|
|
|
101 |
.circle-logo {
|
102 |
+
display: inline-block;
|
103 |
+
width: 40px;
|
104 |
+
height: 40px;
|
105 |
+
border-radius: 50%;
|
106 |
+
overflow: hidden;
|
107 |
+
margin-right: 10px;
|
108 |
+
vertical-align: middle;
|
109 |
+
}
|
110 |
+
|
111 |
+
.circle-logo img {
|
112 |
+
width: 100%;
|
113 |
+
height: 100%;
|
114 |
+
object-fit: cover;
|
115 |
+
}
|
116 |
+
|
117 |
+
.response-with-logo {
|
118 |
+
display: flex;
|
119 |
+
align-items: center;
|
120 |
+
margin-bottom: 10px;
|
121 |
+
}
|
|
|
|
|
122 |
|
123 |
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
gr.ChatInterface(predict,
|
125 |
title="FernAi_chatBot",
|
126 |
css=css,
|
127 |
description="Ask any Redfernstech any questions",
|
128 |
clear_btn=None, undo_btn=None, retry_btn=None,
|
129 |
examples=['Tell me about Redfernstech?', 'Services in Redfernstech?']
|
130 |
+
).launch()
|