Spaces:
Runtime error
Runtime error
Commit
·
2d76394
1
Parent(s):
1bb54f0
Update app.py
Browse files
app.py
CHANGED
@@ -120,6 +120,7 @@ def main(args):
|
|
120 |
# favicon_path=LOGO, # what icon should we display in the address bar?
|
121 |
)
|
122 |
|
|
|
123 |
def make_frontend(
|
124 |
fn: Callable[[Image], str], flagging: bool = False, gantry: bool = False, app_name: str = "fashion-aggregator"
|
125 |
):
|
@@ -127,29 +128,32 @@ def make_frontend(
|
|
127 |
|
128 |
allow_flagging = "never"
|
129 |
|
130 |
-
# HTML code to include the logo
|
131 |
-
|
132 |
-
|
133 |
-
<img src='{LOGO}' alt='Logo' style='position: absolute; top: 0; left: 0; width: 100px; height: 100px;' />
|
134 |
-
<p>This web app is for demonstration purposes only and not intended for commercial use.</p>
|
135 |
-
</div>
|
136 |
-
"""
|
137 |
-
|
138 |
# Build a customized browser interface to a Python function
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
)
|
151 |
|
152 |
-
return
|
|
|
|
|
153 |
|
154 |
# def make_frontend(
|
155 |
# fn: Callable[[Image], str], flagging: bool = False, gantry: bool = False, app_name: str = "fashion-aggregator"
|
|
|
120 |
# favicon_path=LOGO, # what icon should we display in the address bar?
|
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 |
|
129 |
allow_flagging = "never"
|
130 |
|
131 |
+
# HTML code to include the logo
|
132 |
+
logo_html = f"<img src='path_to_your_logo' alt='Logo' style='width: 100px; height: 100px;' />"
|
133 |
+
|
|
|
|
|
|
|
|
|
|
|
134 |
# Build a customized browser interface to a Python function
|
135 |
+
layout = gr.Layout(
|
136 |
+
gr.Row(
|
137 |
+
[
|
138 |
+
gr.Column([gr.outputs.HTML(logo_html), gr.Interface(
|
139 |
+
fn=fn,
|
140 |
+
outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
|
141 |
+
inputs=gr.inputs.Textbox(label="Item Description", placeholder="Enter item description here"),
|
142 |
+
title="Fashion Aggregator",
|
143 |
+
thumbnail=LOGO,
|
144 |
+
description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
145 |
+
cache_examples=False,
|
146 |
+
allow_flagging=allow_flagging,
|
147 |
+
flagging_options=["incorrect", "offensive", "other"],
|
148 |
+
)]),
|
149 |
+
gr.Column([gr.outputs.HTML("This web app is for demonstration purposes only and not intended for commercial use.")])
|
150 |
+
]
|
151 |
+
)
|
152 |
)
|
153 |
|
154 |
+
return layout
|
155 |
+
|
156 |
+
|
157 |
|
158 |
# def make_frontend(
|
159 |
# fn: Callable[[Image], str], flagging: bool = False, gantry: bool = False, app_name: str = "fashion-aggregator"
|