epochs-demos commited on
Commit
5d2687c
·
1 Parent(s): b5c918b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -9
app.py CHANGED
@@ -128,22 +128,55 @@ def make_frontend(
128
 
129
  allow_flagging = "never"
130
 
131
- textbox = gr.components.Textbox(label="Item Description")
132
- gallery = gr.Gallery(label="Relevant Items", examples_per_row=4, show_labels=True)
133
 
134
  # Build a customized browser interface to a Python function
135
  frontend = gr.Interface(
136
  fn=fn,
137
- outputs=gr.outputs.Group([gr.outputs.HTML(""), gallery]),
138
- inputs=gr.inputs.Group([textbox]),
139
- title="Fashion Aggregator", # Update the title to a more descriptive name
140
- thumbnail="./1001epochs.png", # Replace with the path to your company logo image
141
  description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
142
- cache_examples=False,
143
  allow_flagging=allow_flagging,
144
  flagging_options=["incorrect", "offensive", "other"],
145
  )
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
 
148
  # # Build a customized browser interface to a Python function
149
  # frontend = gr.Interface(
@@ -158,8 +191,8 @@ def make_frontend(
158
  # flagging_options=["incorrect", "offensive", "other"],
159
  # )
160
 
161
- # Customize the HTML template to enhance the design and layout
162
- frontend.template = "gradio/custom.html"
163
 
164
  return frontend
165
 
 
128
 
129
  allow_flagging = "never"
130
 
131
+ textbox = gr.inputs.Textbox(label="Item Description")
132
+ gallery = gr.outputs.Gallery(label="Relevant Items", examples_per_row=4, show_labels=True)
133
 
134
  # Build a customized browser interface to a Python function
135
  frontend = gr.Interface(
136
  fn=fn,
137
+ outputs=[gr.outputs.HTML(""), gallery],
138
+ inputs=textbox,
139
+ title="Fashion Aggregator",
140
+ thumbnail="path/to/company-logo.png",
141
  description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
142
+ cache_in_memory=False,
143
  allow_flagging=allow_flagging,
144
  flagging_options=["incorrect", "offensive", "other"],
145
  )
146
 
147
+ # Customize the HTML template to include the disclaimer
148
+ frontend.template = """
149
+ <!DOCTYPE html>
150
+ <html>
151
+ <head>
152
+ <style>
153
+ /* Modify the styles according to your preferences */
154
+ .gradio-interface-container {
155
+ text-align: center;
156
+ }
157
+ .gradio-input-container {
158
+ margin-bottom: 20px;
159
+ }
160
+ .gradio-output-container {
161
+ margin-top: 20px;
162
+ }
163
+ .disclaimer {
164
+ font-size: 12px;
165
+ color: #777777;
166
+ margin-top: 20px;
167
+ text-align: center;
168
+ }
169
+ </style>
170
+ </head>
171
+ <body>
172
+ {{interface_html}}
173
+ <div class="disclaimer">
174
+ This web app is for demonstration purposes only and not intended for commercial use.
175
+ </div>
176
+ </body>
177
+ </html>
178
+ """
179
+
180
 
181
  # # Build a customized browser interface to a Python function
182
  # frontend = gr.Interface(
 
191
  # flagging_options=["incorrect", "offensive", "other"],
192
  # )
193
 
194
+ # # Customize the HTML template to enhance the design and layout
195
+ # frontend.template = "gradio/custom.html"
196
 
197
  return frontend
198