epochs-demos commited on
Commit
2d76394
·
1 Parent(s): 1bb54f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -20
app.py CHANGED
@@ -120,6 +120,7 @@ def main(args):
120
  # favicon_path=LOGO, # what icon should we display in the address bar?
121
  )
122
 
 
123
  def make_frontend(
124
  fn: Callable[[Image], str], flagging: bool = False, gantry: bool = False, app_name: str = "fashion-aggregator"
125
  ):
@@ -127,29 +128,32 @@ def make_frontend(
127
 
128
  allow_flagging = "never"
129
 
130
- # HTML code to include the logo and the disclaimer
131
- markdown = """
132
- <div style='text-align: center;'>
133
- <img src='{LOGO}' alt='Logo' style='position: absolute; top: 0; left: 0; width: 100px; height: 100px;' />
134
- <p>This web app is for demonstration purposes only and not intended for commercial use.</p>
135
- </div>
136
- """
137
-
138
  # Build a customized browser interface to a Python function
139
- frontend = gr.Interface(
140
- fn=fn,
141
- outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
142
- inputs=gr.inputs.Textbox(label="Item Description", placeholder="Enter item description here"),
143
- title="Fashion Aggregator",
144
- thumbnail=LOGO,
145
- description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
146
- markdown=markdown,
147
- cache_examples=False,
148
- allow_flagging=allow_flagging,
149
- flagging_options=["incorrect", "offensive", "other"],
 
 
 
 
 
 
150
  )
151
 
152
- return frontend
 
 
153
 
154
  # def make_frontend(
155
  # fn: Callable[[Image], str], flagging: bool = False, gantry: bool = False, app_name: str = "fashion-aggregator"
 
120
  # favicon_path=LOGO, # what icon should we display in the address bar?
121
  )
122
 
123
+
124
  def make_frontend(
125
  fn: Callable[[Image], str], flagging: bool = False, gantry: bool = False, app_name: str = "fashion-aggregator"
126
  ):
 
128
 
129
  allow_flagging = "never"
130
 
131
+ # HTML code to include the logo
132
+ logo_html = f"<img src='path_to_your_logo' alt='Logo' style='width: 100px; height: 100px;' />"
133
+
 
 
 
 
 
134
  # Build a customized browser interface to a Python function
135
+ layout = gr.Layout(
136
+ gr.Row(
137
+ [
138
+ gr.Column([gr.outputs.HTML(logo_html), gr.Interface(
139
+ fn=fn,
140
+ outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
141
+ inputs=gr.inputs.Textbox(label="Item Description", placeholder="Enter item description here"),
142
+ title="Fashion Aggregator",
143
+ thumbnail=LOGO,
144
+ description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
145
+ cache_examples=False,
146
+ allow_flagging=allow_flagging,
147
+ flagging_options=["incorrect", "offensive", "other"],
148
+ )]),
149
+ gr.Column([gr.outputs.HTML("This web app is for demonstration purposes only and not intended for commercial use.")])
150
+ ]
151
+ )
152
  )
153
 
154
+ return layout
155
+
156
+
157
 
158
  # def make_frontend(
159
  # fn: Callable[[Image], str], flagging: bool = False, gantry: bool = False, app_name: str = "fashion-aggregator"