Spaces:
Runtime error
Runtime error
Commit
·
a2b8dec
1
Parent(s):
b30f27a
Update app.py
Browse files
app.py
CHANGED
@@ -127,14 +127,13 @@ def make_frontend(
|
|
127 |
"""Creates a gradio.Interface frontend for text to image search function."""
|
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="
|
138 |
description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
139 |
cache_examples=False,
|
140 |
allow_flagging=allow_flagging,
|
@@ -144,31 +143,41 @@ def make_frontend(
|
|
144 |
# Apply custom CSS styles to enhance the design and layout
|
145 |
frontend.styles(
|
146 |
# Modify the styles according to your preferences
|
147 |
-
title="color: #333333; font-size: 28px; font-weight: bold; margin-bottom: 10px;",
|
148 |
-
description="color: #666666; font-size: 16px; margin-bottom: 20px;",
|
149 |
-
input="padding: 10px; border-radius: 5px; border: 1px solid #dddddd; font-size: 16px; width: 80%;",
|
150 |
output_gallery="margin-top: 20px;",
|
151 |
output_image="border-radius: 10px; box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);",
|
152 |
flag_button="background-color: #ff5555;",
|
153 |
flag_options="color: #333333;",
|
154 |
)
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
# # build a basic browser interface to a Python function
|
159 |
# frontend = gr.Interface(
|
160 |
-
# fn=fn,
|
161 |
# outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
|
162 |
-
#
|
163 |
-
#
|
164 |
-
#
|
165 |
-
#
|
166 |
-
#
|
167 |
-
#
|
168 |
-
#
|
169 |
-
# flagging_options=["incorrect", "offensive", "other"], # what options do users have for feedback?
|
170 |
# )
|
171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
|
174 |
class PredictorBackend:
|
|
|
127 |
"""Creates a gradio.Interface frontend for text to image search function."""
|
128 |
|
129 |
allow_flagging = "never"
|
|
|
130 |
# Build a customized browser interface to a Python function
|
131 |
frontend = gr.Interface(
|
132 |
fn=fn,
|
133 |
outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
|
134 |
inputs=gr.inputs.Textbox(label="Item Description", placeholder="Enter item description here"),
|
135 |
+
title="Fashion Aggregator", # Update the title to a more descriptive name
|
136 |
+
thumbnail="path/to/company-logo.png", # Replace with the path to your company logo image
|
137 |
description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
138 |
cache_examples=False,
|
139 |
allow_flagging=allow_flagging,
|
|
|
143 |
# Apply custom CSS styles to enhance the design and layout
|
144 |
frontend.styles(
|
145 |
# Modify the styles according to your preferences
|
146 |
+
title="color: #333333; font-size: 28px; font-weight: bold; margin-bottom: 10px; text-align: center;",
|
147 |
+
description="color: #666666; font-size: 16px; margin-bottom: 20px; text-align: center;",
|
148 |
+
input="padding: 10px; border-radius: 5px; border: 1px solid #dddddd; font-size: 16px; width: 80%; margin: 0 auto;",
|
149 |
output_gallery="margin-top: 20px;",
|
150 |
output_image="border-radius: 10px; box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);",
|
151 |
flag_button="background-color: #ff5555;",
|
152 |
flag_options="color: #333333;",
|
153 |
)
|
154 |
+
|
155 |
+
# # Build a customized browser interface to a Python function
|
|
|
|
|
156 |
# frontend = gr.Interface(
|
157 |
+
# fn=fn,
|
158 |
# outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
|
159 |
+
# inputs=gr.inputs.Textbox(label="Item Description", placeholder="Enter item description here"),
|
160 |
+
# title="Fashion Aggregator", # Title
|
161 |
+
# thumbnail="./1001epochs.png", # Company logo image
|
162 |
+
# description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
163 |
+
# cache_examples=False,
|
164 |
+
# allow_flagging=allow_flagging,
|
165 |
+
# flagging_options=["incorrect", "offensive", "other"],
|
|
|
166 |
# )
|
167 |
+
|
168 |
+
# # Apply custom CSS styles to enhance the design and layout
|
169 |
+
# frontend.styles(
|
170 |
+
# # Modify the styles according to your preferences
|
171 |
+
# title="color: #333333; font-size: 28px; font-weight: bold; margin-bottom: 10px;",
|
172 |
+
# description="color: #666666; font-size: 16px; margin-bottom: 20px;",
|
173 |
+
# input="padding: 10px; border-radius: 5px; border: 1px solid #dddddd; font-size: 16px; width: 80%;",
|
174 |
+
# output_gallery="margin-top: 20px;",
|
175 |
+
# output_image="border-radius: 10px; box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);",
|
176 |
+
# flag_button="background-color: #ff5555;",
|
177 |
+
# flag_options="color: #333333;",
|
178 |
+
# )
|
179 |
+
|
180 |
+
return frontend
|
181 |
|
182 |
|
183 |
class PredictorBackend:
|