epochs-demos commited on
Commit
a441b42
·
1 Parent(s): e670f01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -125,11 +125,6 @@ def main(args):
125
  def make_frontend(fn: Callable[[str], List[str]], app_name: str = "fashion-aggregator"):
126
  """Creates a gradio.Interface frontend for text to image search function."""
127
 
128
- def preprocess_input(input_str):
129
- paths_and_scores = fn(input_str)
130
- images = [gr.utils.image.load_image(path) for path in paths_and_scores]
131
- return images
132
-
133
  input_section = gr.inputs.Textbox(lines=2, placeholder="Enter item description here")
134
 
135
  output_section = gr.Gallery(label="Relevant Items", show_labels=True, label_position="below")
@@ -158,7 +153,7 @@ def make_frontend(fn: Callable[[str], List[str]], app_name: str = "fashion-aggre
158
 
159
  # Build a customized browser interface to a Python function
160
  frontend = gr.Interface(
161
- fn=preprocess_input,
162
  inputs=input_section,
163
  outputs=output_section,
164
  layout=interface_layout,
 
125
  def make_frontend(fn: Callable[[str], List[str]], app_name: str = "fashion-aggregator"):
126
  """Creates a gradio.Interface frontend for text to image search function."""
127
 
 
 
 
 
 
128
  input_section = gr.inputs.Textbox(lines=2, placeholder="Enter item description here")
129
 
130
  output_section = gr.Gallery(label="Relevant Items", show_labels=True, label_position="below")
 
153
 
154
  # Build a customized browser interface to a Python function
155
  frontend = gr.Interface(
156
+ fn=fn,
157
  inputs=input_section,
158
  outputs=output_section,
159
  layout=interface_layout,