Spanicin commited on
Commit
3535970
·
verified ·
1 Parent(s): 9b018cd

Update app_parallel.py

Browse files
Files changed (1) hide show
  1. app_parallel.py +2 -2
app_parallel.py CHANGED
@@ -363,8 +363,8 @@ def parallel_processing():
363
  def stream_results():
364
  global future_to_chunk
365
  def generate():
366
- for future in as_completed(future_results):
367
- idx = future_results.index(future)
368
  try:
369
  base64_video, temp_file_path = future.result()
370
  yield json.dumps({'start_time': idx, 'path': temp_file_path}).encode('utf-8')
 
363
  def stream_results():
364
  global future_to_chunk
365
  def generate():
366
+ for future in as_completed(future_to_chunk):
367
+ idx = future_to_chunk[future]
368
  try:
369
  base64_video, temp_file_path = future.result()
370
  yield json.dumps({'start_time': idx, 'path': temp_file_path}).encode('utf-8')