Spaces:
Runtime error
Runtime error
Commit
·
1bb54f0
1
Parent(s):
89598c8
Update app.py
Browse files
app.py
CHANGED
@@ -120,7 +120,6 @@ def main(args):
|
|
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,6 +127,14 @@ def make_frontend(
|
|
128 |
|
129 |
allow_flagging = "never"
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
# Build a customized browser interface to a Python function
|
132 |
frontend = gr.Interface(
|
133 |
fn=fn,
|
@@ -136,6 +143,7 @@ def make_frontend(
|
|
136 |
title="Fashion Aggregator",
|
137 |
thumbnail=LOGO,
|
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"],
|
@@ -143,6 +151,28 @@ def make_frontend(
|
|
143 |
|
144 |
return frontend
|
145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
class PredictorBackend:
|
148 |
"""Interface to a backend that serves predictions.
|
|
|
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 |
|
128 |
allow_flagging = "never"
|
129 |
|
130 |
+
# HTML code to include the logo and the disclaimer
|
131 |
+
markdown = """
|
132 |
+
<div style='text-align: center;'>
|
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 |
frontend = gr.Interface(
|
140 |
fn=fn,
|
|
|
143 |
title="Fashion Aggregator",
|
144 |
thumbnail=LOGO,
|
145 |
description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
146 |
+
markdown=markdown,
|
147 |
cache_examples=False,
|
148 |
allow_flagging=allow_flagging,
|
149 |
flagging_options=["incorrect", "offensive", "other"],
|
|
|
151 |
|
152 |
return frontend
|
153 |
|
154 |
+
# def make_frontend(
|
155 |
+
# fn: Callable[[Image], str], flagging: bool = False, gantry: bool = False, app_name: str = "fashion-aggregator"
|
156 |
+
# ):
|
157 |
+
# """Creates a gradio.Interface frontend for text to image search function."""
|
158 |
+
|
159 |
+
# allow_flagging = "never"
|
160 |
+
|
161 |
+
# # Build a customized browser interface to a Python function
|
162 |
+
# frontend = gr.Interface(
|
163 |
+
# fn=fn,
|
164 |
+
# outputs=gr.Gallery(label="Relevant Items", show_labels=True, label_position="below"),
|
165 |
+
# inputs=gr.inputs.Textbox(label="Item Description", placeholder="Enter item description here"),
|
166 |
+
# title="Fashion Aggregator",
|
167 |
+
# thumbnail=LOGO,
|
168 |
+
# description="Discover your perfect apparel effortlessly. Simply describe what you're looking for!",
|
169 |
+
# cache_examples=False,
|
170 |
+
# allow_flagging=allow_flagging,
|
171 |
+
# flagging_options=["incorrect", "offensive", "other"],
|
172 |
+
# )
|
173 |
+
|
174 |
+
# return frontend
|
175 |
+
|
176 |
|
177 |
class PredictorBackend:
|
178 |
"""Interface to a backend that serves predictions.
|