LAP-DEV commited on
Commit
d9a2963
·
verified ·
1 Parent(s): 549aba9

Update modules/whisper/whisper_base.py

Browse files
Files changed (1) hide show
  1. modules/whisper/whisper_base.py +11 -14
modules/whisper/whisper_base.py CHANGED
@@ -413,20 +413,17 @@ class WhisperBase(ABC):
413
  if file_count > 1:
414
  total_info += f'\n'
415
 
416
- # Add filename as column if multiple file processing
417
- if process_multiple:
418
- temp_lines = {info["subtitle"]}
419
- line_count = 0
420
- result_fixed = ""
421
- for temp_line in temp_lines:
422
- line_count += 1
423
- if line_count==1:
424
- result_fixed += info["input_source_file"]+"\t"+temp_line
425
- else:
426
- result_fixed += "\t"+temp_line
427
- total_result += result_fixed
428
- else:
429
- total_result += f'{info["subtitle"]}'
430
 
431
  total_time += info["time_for_task"]
432
  total_info += f'Media file:\t{info["input_source_file"]}\nLanguage:\t{info["lang"]} (probability {info["lang_prob"]}%)\n'
 
413
  if file_count > 1:
414
  total_info += f'\n'
415
 
416
+ # Add filename as first column (first line only)
417
+ line_count = 0
418
+ result_fixed = ""
419
+ temp_lines = {info["subtitle"]}.splitlines()
420
+ for temp_line in temp_lines:
421
+ line_count += 1
422
+ if line_count==1:
423
+ result_fixed += info["input_source_file"]+"\t"+temp_line
424
+ else:
425
+ result_fixed += "\t"+temp_line
426
+ total_result += result_fixed
 
 
 
427
 
428
  total_time += info["time_for_task"]
429
  total_info += f'Media file:\t{info["input_source_file"]}\nLanguage:\t{info["lang"]} (probability {info["lang_prob"]}%)\n'