Spaces:
Runtime error
Runtime error
Commit
·
c62a676
1
Parent(s):
20a098c
Update app.py
Browse files
app.py
CHANGED
@@ -121,6 +121,8 @@ def main(args):
|
|
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,13 +130,16 @@ def make_frontend(
|
|
128 |
|
129 |
allow_flagging = "never"
|
130 |
|
131 |
-
#
|
|
|
|
|
|
|
132 |
frontend = gr.Interface(
|
133 |
fn=fn,
|
134 |
-
inputs=gr.inputs.Textbox(label="Item Description", placeholder="Enter item description here"),
|
135 |
outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
|
136 |
-
|
137 |
-
|
|
|
138 |
description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
139 |
cache_examples=False,
|
140 |
allow_flagging=allow_flagging,
|
@@ -176,13 +181,7 @@ def make_frontend(
|
|
176 |
<body>
|
177 |
{{interface_html}}
|
178 |
<div class="disclaimer">
|
179 |
-
|
180 |
-
<gr-row>
|
181 |
-
<gr-column>
|
182 |
-
<span>Disclaimer: This web app is for demonstration purposes only and not intended for commercial use.</span>
|
183 |
-
</gr-column>
|
184 |
-
</gr-row>
|
185 |
-
</gr-blocks>
|
186 |
</div>
|
187 |
</body>
|
188 |
</html>
|
@@ -190,6 +189,7 @@ def make_frontend(
|
|
190 |
|
191 |
return frontend
|
192 |
|
|
|
193 |
# def make_frontend(
|
194 |
# fn: Callable[[Image], str], flagging: bool = False, gantry: bool = False, app_name: str = "fashion-aggregator"
|
195 |
# ):
|
|
|
121 |
)
|
122 |
|
123 |
|
124 |
+
from PIL import Image
|
125 |
+
|
126 |
def make_frontend(
|
127 |
fn: Callable[[Image], str], flagging: bool = False, gantry: bool = False, app_name: str = "fashion-aggregator"
|
128 |
):
|
|
|
130 |
|
131 |
allow_flagging = "never"
|
132 |
|
133 |
+
# Resize the logo image to a smaller size
|
134 |
+
resized_logo = Image.open(LOGO).resize((100, 100)) # Adjust the size as per your preference
|
135 |
+
|
136 |
+
# Build a customized browser interface to a Python function
|
137 |
frontend = gr.Interface(
|
138 |
fn=fn,
|
|
|
139 |
outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
|
140 |
+
inputs=gr.inputs.Textbox(label="Item Description", placeholder="Enter item description here"),
|
141 |
+
title="<span class='title-text'>Fashion Aggregator</span><img src='{logo}' class='logo-image'>".format(logo=resized_logo),
|
142 |
+
thumbnail=FAVICON,
|
143 |
description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
144 |
cache_examples=False,
|
145 |
allow_flagging=allow_flagging,
|
|
|
181 |
<body>
|
182 |
{{interface_html}}
|
183 |
<div class="disclaimer">
|
184 |
+
This web app is for demonstration purposes only and not intended for commercial use.
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
</div>
|
186 |
</body>
|
187 |
</html>
|
|
|
189 |
|
190 |
return frontend
|
191 |
|
192 |
+
|
193 |
# def make_frontend(
|
194 |
# fn: Callable[[Image], str], flagging: bool = False, gantry: bool = False, app_name: str = "fashion-aggregator"
|
195 |
# ):
|