Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -247,13 +247,14 @@ def parallel(timeout,*pairs):
|
|
| 247 |
while True:
|
| 248 |
command = await queue.get()
|
| 249 |
await queue.put(command.func(*command.data))
|
| 250 |
-
|
|
|
|
| 251 |
with LaunchAsync(async_main) as queue:
|
| 252 |
for pair in pairs:
|
| 253 |
f = pair.pop(0)
|
| 254 |
queue.put(Command(f, pair))
|
| 255 |
-
|
| 256 |
-
|
| 257 |
return out
|
| 258 |
|
| 259 |
# functionality
|
|
@@ -412,7 +413,6 @@ def ui():
|
|
| 412 |
with gr.Row():
|
| 413 |
result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
|
| 414 |
result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
|
| 415 |
-
result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
|
| 416 |
|
| 417 |
gr.on(
|
| 418 |
triggers=[
|
|
|
|
| 247 |
while True:
|
| 248 |
command = await queue.get()
|
| 249 |
await queue.put(command.func(*command.data))
|
| 250 |
+
out.append(queue.get(timeout=timeout))
|
| 251 |
+
|
| 252 |
with LaunchAsync(async_main) as queue:
|
| 253 |
for pair in pairs:
|
| 254 |
f = pair.pop(0)
|
| 255 |
queue.put(Command(f, pair))
|
| 256 |
+
while len(out) < len(pairs):
|
| 257 |
+
time.sleep(5)
|
| 258 |
return out
|
| 259 |
|
| 260 |
# functionality
|
|
|
|
| 413 |
with gr.Row():
|
| 414 |
result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
|
| 415 |
result.append(gr.Image(interactive=False,elem_classes="image-container", label="Result", show_label=False, type='filepath', show_share_button=False))
|
|
|
|
| 416 |
|
| 417 |
gr.on(
|
| 418 |
triggers=[
|