Spanicin commited on
Commit
f1cbe8a
·
verified ·
1 Parent(s): e2c4695

Update app_parallel.py

Browse files
Files changed (1) hide show
  1. app_parallel.py +6 -1
app_parallel.py CHANGED
@@ -311,7 +311,12 @@ def generate_chunks(audio_chunks, preprocessed_data, args, m3u8_path, audio_dura
311
  add_video(processed_chunks[expected_start_time], m3u8_path, audio_duration)
312
  end_time = time.time()
313
  elapsed_time = end_time - start_time
314
- yield json.dumps({'start_time': expected_start_time, 'video_index': yielded_count, 'elapsed_time': elapsed_time}).encode('utf-8')
 
 
 
 
 
315
  processed_chunks[expected_start_time] = None
316
  yielded_count += 1
317
  else:
 
311
  add_video(processed_chunks[expected_start_time], m3u8_path, audio_duration)
312
  end_time = time.time()
313
  elapsed_time = end_time - start_time
314
+ event_data = json.dumps({
315
+ 'start_time': expected_start_time,
316
+ 'video_index': yielded_count,
317
+ 'elapsed_time': elapsed_time
318
+ })
319
+ yield f"data: {event_data}\n\n"
320
  processed_chunks[expected_start_time] = None
321
  yielded_count += 1
322
  else: