Spaces:
Runtime error
Runtime error
Commit
·
cdff949
1
Parent(s):
5d2687c
Update app.py
Browse files
app.py
CHANGED
@@ -128,72 +128,19 @@ def make_frontend(
|
|
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=
|
138 |
-
inputs=
|
139 |
-
title="Fashion Aggregator",
|
140 |
-
thumbnail=
|
141 |
description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
142 |
-
|
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(
|
183 |
-
# fn=fn,
|
184 |
-
# outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
|
185 |
-
# inputs=gr.inputs.Textbox(label="Item Description", placeholder="Enter item description here"),
|
186 |
-
# title="Fashion Aggregator",
|
187 |
-
# thumbnail=FAVICON,
|
188 |
-
# description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
189 |
-
# cache_examples=False,
|
190 |
-
# allow_flagging=allow_flagging,
|
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 |
|
199 |
|
|
|
128 |
|
129 |
allow_flagging = "never"
|
130 |
|
|
|
|
|
|
|
131 |
# Build a customized browser interface to a Python function
|
132 |
frontend = gr.Interface(
|
133 |
fn=fn,
|
134 |
+
outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
|
135 |
+
inputs=gr.inputs.Textbox(label="Item Description", placeholder="Enter item description here"),
|
136 |
+
title="Fashion Aggregator",
|
137 |
+
thumbnail=FAVICON,
|
138 |
description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
139 |
+
cache_examples=False,
|
140 |
allow_flagging=allow_flagging,
|
141 |
flagging_options=["incorrect", "offensive", "other"],
|
142 |
)
|
143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
return frontend
|
145 |
|
146 |
|