update
Browse files
app.py
CHANGED
@@ -51,20 +51,17 @@ def recommendation_interface(channel, device_type, query_text):
|
|
51 |
return form.get_recommendations(channel, device_type, query_text)
|
52 |
|
53 |
|
54 |
-
with gr.Blocks() as interface:
|
55 |
-
gr.Markdown(
|
56 |
-
|
57 |
-
)
|
58 |
-
|
59 |
-
with gr.Row(): # Use Row to place components side by side
|
60 |
with gr.Column():
|
61 |
channel_dropdown = gr.Dropdown(choices=form.channel_options, label="Channel")
|
62 |
device_dropdown = gr.Dropdown(choices=form.device_type_options, label="Device Type")
|
63 |
query_input = gr.Textbox(value=form.default_query_text, label="Query Text")
|
64 |
-
submit_button = gr.Button("Submit",
|
65 |
|
66 |
with gr.Column(scale=3):
|
67 |
-
gr.Markdown("
|
68 |
recommendation_output = gr.Dataframe(
|
69 |
show_label=False,
|
70 |
headers = [
|
@@ -84,19 +81,10 @@ with gr.Blocks() as interface:
|
|
84 |
outputs=recommendation_output,
|
85 |
)
|
86 |
|
87 |
-
# Add custom CSS for styling
|
88 |
interface.css = """
|
89 |
-
#
|
90 |
-
|
91 |
-
|
92 |
-
border: none;
|
93 |
-
padding: 10px 20px;
|
94 |
-
font-size: 16px;
|
95 |
-
border-radius: 5px;
|
96 |
-
cursor: pointer;
|
97 |
-
}
|
98 |
-
#submit-button:hover {
|
99 |
-
background-color: #FF8C00;
|
100 |
}
|
101 |
"""
|
102 |
|
|
|
51 |
return form.get_recommendations(channel, device_type, query_text)
|
52 |
|
53 |
|
54 |
+
with gr.Blocks(theme= gr.themes.Origin(text_size="md", spacing_size="lg"), title="E-Commerce Recommendation Engine Demo") as interface:
|
55 |
+
gr.Markdown("# E-Commerce Recommendation Engine Demo", elem_id='title')
|
56 |
+
with gr.Row():
|
|
|
|
|
|
|
57 |
with gr.Column():
|
58 |
channel_dropdown = gr.Dropdown(choices=form.channel_options, label="Channel")
|
59 |
device_dropdown = gr.Dropdown(choices=form.device_type_options, label="Device Type")
|
60 |
query_input = gr.Textbox(value=form.default_query_text, label="Query Text")
|
61 |
+
submit_button = gr.Button("Submit", variant="primary")
|
62 |
|
63 |
with gr.Column(scale=3):
|
64 |
+
gr.Markdown("## Top Recommendations:")
|
65 |
recommendation_output = gr.Dataframe(
|
66 |
show_label=False,
|
67 |
headers = [
|
|
|
81 |
outputs=recommendation_output,
|
82 |
)
|
83 |
|
|
|
84 |
interface.css = """
|
85 |
+
#title {
|
86 |
+
text-align: center;
|
87 |
+
margin: 20px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
"""
|
90 |
|