Spanicin commited on
Commit
b75176e
·
verified ·
1 Parent(s): daa578b

Update app_parallel.py

Browse files
Files changed (1) hide show
  1. app_parallel.py +4 -1
app_parallel.py CHANGED
@@ -306,7 +306,10 @@ def generate_chunks(audio_chunks, preprocessed_data, args, m3u8_path, audio_dura
306
  processed_chunks[idx] = temp_file_path
307
  for expected_start_time in sorted(processed_chunks.keys()):
308
  if processed_chunks[expected_start_time] is not None:
309
- await asyncio.run(add_video(processed_chunks[expected_start_time], m3u8_path, audio_duration))
 
 
 
310
  yield json.dumps({'start_time': expected_start_time, 'video_index': yielded_count}).encode('utf-8')
311
  processed_chunks[expected_start_time] = None
312
  yielded_count += 1
 
306
  processed_chunks[idx] = temp_file_path
307
  for expected_start_time in sorted(processed_chunks.keys()):
308
  if processed_chunks[expected_start_time] is not None:
309
+ loop = asyncio.new_event_loop()
310
+ asyncio.set_event_loop(loop)
311
+ loop.run_until_complete(add_video(processed_chunks[expected_start_time], m3u8_path, audio_duration)
312
+ loop.close()
313
  yield json.dumps({'start_time': expected_start_time, 'video_index': yielded_count}).encode('utf-8')
314
  processed_chunks[expected_start_time] = None
315
  yielded_count += 1