sagravela commited on
Commit
c21d04d
·
1 Parent(s): 88a5159
Files changed (1) hide show
  1. app.py +8 -20
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
- "<h1 style='color:#E76E00; text-align: center; font-weight: bold; font-size: 40px; margin: 60px; margin-bottom: 30px !important;'>E-Commerce Recommendation Engine Demo</h1>"
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", elem_id="submit-button")
65
 
66
  with gr.Column(scale=3):
67
- gr.Markdown("<h2>Top Recommendations:</h2>")
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
- #submit-button {
90
- background-color: #E76E00;
91
- color: black;
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