Spaces:
Runtime error
Runtime error
Commit
•
1ef6a67
1
Parent(s):
bc048f8
Update app.py
Browse files
app.py
CHANGED
@@ -127,13 +127,32 @@ def make_frontend(
|
|
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", #
|
136 |
-
# thumbnail="
|
137 |
# description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
138 |
# cache_examples=False,
|
139 |
# allow_flagging=allow_flagging,
|
@@ -143,41 +162,16 @@ def make_frontend(
|
|
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;
|
147 |
-
# description="color: #666666; font-size: 16px; margin-bottom: 20px;
|
148 |
-
# input="padding: 10px; border-radius: 5px; border: 1px solid #dddddd; font-size: 16px; width: 80%;
|
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 |
-
#
|
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:
|
|
|
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", # Update the title to a more descriptive name
|
137 |
+
thumbnail="path/to/company-logo.png", # Replace with the path to your company logo image
|
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 |
+
# Customize the HTML template to enhance the design and layout
|
145 |
+
frontend.template = "gradio/custom.html"
|
146 |
+
|
147 |
+
return frontend
|
148 |
+
|
149 |
# # Build a customized browser interface to a Python function
|
150 |
# frontend = gr.Interface(
|
151 |
# fn=fn,
|
152 |
# outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
|
153 |
# inputs=gr.inputs.Textbox(label="Item Description", placeholder="Enter item description here"),
|
154 |
+
# title="Fashion Aggregator", # Title
|
155 |
+
# thumbnail="./1001epochs.png", # Company logo image
|
156 |
# description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
157 |
# cache_examples=False,
|
158 |
# allow_flagging=allow_flagging,
|
|
|
162 |
# # Apply custom CSS styles to enhance the design and layout
|
163 |
# frontend.styles(
|
164 |
# # Modify the styles according to your preferences
|
165 |
+
# title="color: #333333; font-size: 28px; font-weight: bold; margin-bottom: 10px;",
|
166 |
+
# description="color: #666666; font-size: 16px; margin-bottom: 20px;",
|
167 |
+
# input="padding: 10px; border-radius: 5px; border: 1px solid #dddddd; font-size: 16px; width: 80%;",
|
168 |
# output_gallery="margin-top: 20px;",
|
169 |
# output_image="border-radius: 10px; box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);",
|
170 |
# flag_button="background-color: #ff5555;",
|
171 |
# flag_options="color: #333333;",
|
172 |
# )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
|
174 |
+
# return frontend
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
|
177 |
class PredictorBackend:
|