Update app.py
Browse files
app.py
CHANGED
@@ -222,10 +222,10 @@ def build_demo(embed_mode, concurrency_count=1):
|
|
222 |
["./examples/safari_google.png", "Click on search bar.", True],
|
223 |
]
|
224 |
|
225 |
-
def check_if_example(
|
226 |
-
"""Check if the
|
227 |
-
for
|
228 |
-
if
|
229 |
return is_example
|
230 |
return False
|
231 |
|
@@ -233,7 +233,7 @@ def build_demo(embed_mode, concurrency_count=1):
|
|
233 |
examples=[[e[0], e[1]] for e in examples],
|
234 |
inputs=[imagebox, textbox],
|
235 |
outputs=[state_is_example_image],
|
236 |
-
fn=check_if_example,
|
237 |
examples_per_page=3
|
238 |
)
|
239 |
|
|
|
222 |
["./examples/safari_google.png", "Click on search bar.", True],
|
223 |
]
|
224 |
|
225 |
+
def check_if_example(query):
|
226 |
+
"""Check if the query matches an example."""
|
227 |
+
for _, example_query, is_example in examples:
|
228 |
+
if example_query == query:
|
229 |
return is_example
|
230 |
return False
|
231 |
|
|
|
233 |
examples=[[e[0], e[1]] for e in examples],
|
234 |
inputs=[imagebox, textbox],
|
235 |
outputs=[state_is_example_image],
|
236 |
+
fn=lambda img, query: check_if_example(query),
|
237 |
examples_per_page=3
|
238 |
)
|
239 |
|