Update app.py
Browse files
app.py
CHANGED
|
@@ -13,37 +13,31 @@ def chatbot(query):
|
|
| 13 |
best_idx = int(scores.argmax()) # Fix: convert tensor to int
|
| 14 |
return faq_df.iloc[best_idx]['answer']
|
| 15 |
|
| 16 |
-
|
| 17 |
-
custom_theme = gr.themes.Base(
|
| 18 |
-
primary_hue="blue",
|
| 19 |
-
secondary_hue="gray",
|
| 20 |
-
font=["Inter", "sans-serif"],
|
| 21 |
-
radius_size=8,
|
| 22 |
-
spacing_size=4
|
| 23 |
-
)
|
| 24 |
-
|
| 25 |
-
with gr.Blocks(theme=custom_theme, title="LIC Agent Assistant") as demo:
|
| 26 |
gr.Markdown(
|
| 27 |
"""
|
| 28 |
-
#
|
| 29 |
-
|
| 30 |
-
"""
|
|
|
|
| 31 |
)
|
| 32 |
|
| 33 |
with gr.Row():
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
submit_btn = gr.Button("Get Answer", variant="primary")
|
| 47 |
submit_btn.click(fn=chatbot, inputs=user_input, outputs=output)
|
| 48 |
|
| 49 |
demo.launch()
|
|
|
|
| 13 |
best_idx = int(scores.argmax()) # Fix: convert tensor to int
|
| 14 |
return faq_df.iloc[best_idx]['answer']
|
| 15 |
|
| 16 |
+
with gr.Blocks(title="LIC Agent Assistant") as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
gr.Markdown(
|
| 18 |
"""
|
| 19 |
+
<h1 style='text-align: center; color: #1a237e;'>🧑💼 LIC Agent Assistant Chatbot</h1>
|
| 20 |
+
<p style='text-align: center;'>Ask questions about LIC policies, commissions, claims, onboarding, and more!</p>
|
| 21 |
+
""",
|
| 22 |
+
elem_id="header"
|
| 23 |
)
|
| 24 |
|
| 25 |
with gr.Row():
|
| 26 |
+
with gr.Column(scale=1):
|
| 27 |
+
user_input = gr.Textbox(
|
| 28 |
+
label="Your Question",
|
| 29 |
+
placeholder="E.g., How do I file a claim?",
|
| 30 |
+
lines=2
|
| 31 |
+
)
|
| 32 |
+
submit_btn = gr.Button("Get Answer", variant="primary")
|
| 33 |
+
|
| 34 |
+
with gr.Column(scale=1):
|
| 35 |
+
output = gr.Textbox(
|
| 36 |
+
label="Answer",
|
| 37 |
+
placeholder="Response will appear here...",
|
| 38 |
+
lines=6
|
| 39 |
+
)
|
| 40 |
|
|
|
|
| 41 |
submit_btn.click(fn=chatbot, inputs=user_input, outputs=output)
|
| 42 |
|
| 43 |
demo.launch()
|