Update modules/whisper/whisper_base.py
Browse files255 unmodified lines25625725825926026126297 unmodified lines360361362363364365366367368369370371372373374375255 unmodified linesInput folder path to transcribe from gr.Textbox(). If this is provided, `files` will be ignored andthis will be used instead.file_format: strSubtitle File format to write from gr.Dropdown(). Supported format: [SRT, WebVTT, txt]add_timestamp: boolBoolean value from gr.Checkbox() that determines whether to add a timestamp at the end of the subtitle filename.translate_output: bool97 unmodified linesfiles_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "lang": file_language, "lang_prob": file_lang_probs, "input_source_file": (file_name+file_ext), "translation": translation_note, "transcription": transcription_note}## Add output file as txt, srt and/or csvfor format in file_format:file_name, file_ext = os.path.splitext(os.path.basename(file))subtitle, file_path = self.generate_and_write_file(file_name=file_name,transcribed_segments=transcribed_segments,add_timestamp=add_timestamp,file_format=format.lower(),output_dir=self.output_dir)files_to_download[file_name+"_"+format.lower()] = {"path": file_path}total_result = ""total_info = ""255 unmodified lines25625725825926026126297 unmodified lines360361362363364365366367368369255 unmodified linesInput folder path to transcribe from gr.Textbox(). If this is provided, `files` will be ignored andthis will be used instead.file_format: strSubtitle File format to write from gr.Dropdown(). Supported format: [CSV, SRT, TXT]add_timestamp: boolBoolean value from gr.Checkbox() that determines whether to add a timestamp at the end of the subtitle filename.translate_output: bool97 unmodified linesfiles_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "lang": file_language, "lang_prob": file_lang_probs, "input_source_file": (file_name+file_ext), "translation": translation_note, "transcription": transcription_note}## Add output file as txt, srt and/or csvfor output_format in file_format:file_name, file_ext = os.path.splitext(os.path.basename(file))subtitle, file_path = self.generate_and_write_file(file_name,transcribed_segments,add_timestamp,output_format.lower(),self.output_dir)files_to_download[file_name+"_"+output_format.lower()] = {"path": file_path}total_result = ""total_info = ""
modules/whisper/whisper_base.py+4-10