Update app.py
Browse files
app.py
CHANGED
@@ -222,11 +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 image and query match an example."""
|
227 |
for example_path, example_query, is_example in examples:
|
228 |
-
|
229 |
-
if np.array_equal(np.array(example_image), image_array) and example_query == query:
|
230 |
return is_example
|
231 |
return False
|
232 |
|
@@ -300,4 +299,4 @@ if __name__ == "__main__":
|
|
300 |
server_port=7860,
|
301 |
ssr_mode=False,
|
302 |
debug=True,
|
303 |
-
)
|
|
|
222 |
["./examples/safari_google.png", "Click on search bar.", True],
|
223 |
]
|
224 |
|
225 |
+
def check_if_example(image_path, query):
|
226 |
+
"""Check if the image and query match an example using the flag."""
|
227 |
for example_path, example_query, is_example in examples:
|
228 |
+
if example_path == image_path and example_query == query:
|
|
|
229 |
return is_example
|
230 |
return False
|
231 |
|
|
|
299 |
server_port=7860,
|
300 |
ssr_mode=False,
|
301 |
debug=True,
|
302 |
+
)
|