marquesafonso commited on
Commit
45524f7
·
1 Parent(s): 28314a5

validate max_words_per_line input type and provide default

Browse files
Files changed (1) hide show
  1. src/transcriber.py +2 -0
src/transcriber.py CHANGED
@@ -109,6 +109,8 @@ def transcriber(file_input:gr.File,
109
  task:str,
110
  model_version:str,
111
  device_type: str):
 
 
112
  srt_filepath = os.path.normpath(f"{file_input.split('.')[0]}.srt")
113
  if file_type == "video" :
114
  audio_input = convert_video_to_audio(file_input)
 
109
  task:str,
110
  model_version:str,
111
  device_type: str):
112
+ if not isinstance(max_words_per_line, int):
113
+ max_words_per_line = 6
114
  srt_filepath = os.path.normpath(f"{file_input.split('.')[0]}.srt")
115
  if file_type == "video" :
116
  audio_input = convert_video_to_audio(file_input)