RASMUS commited on
Commit
c6fc930
1 Parent(s): 7e2e27e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -233,7 +233,7 @@ def speech_to_text(video_file_path, selected_source_lang, whisper_model):
233
  This space is using c++ implementation by https://github.com/ggerganov/whisper.cpp
234
  """
235
 
236
- if(video_file_path == None):
237
  raise ValueError("Error no video input")
238
  print(video_file_path)
239
  try:
@@ -259,8 +259,7 @@ if(video_file_path == None):
259
  except Exception as e:
260
  raise RuntimeError("Error converting video to audio")
261
 
262
- try:
263
-
264
 
265
  df = pd.DataFrame(columns = ['start','end','text'])
266
  srt_path = str(video_file_path.replace(file_ending, ".wav")) + ".srt"
@@ -302,7 +301,7 @@ if(video_file_path == None):
302
 
303
  def translate_transcriptions(df, selected_translation_lang_2):
304
  if selected_translation_lang_2 is None:
305
- selected_translation_lang_2 = 'English'
306
  df.reset_index(inplace=True)
307
 
308
  print("start_translation")
 
233
  This space is using c++ implementation by https://github.com/ggerganov/whisper.cpp
234
  """
235
 
236
+ if(video_file_path == None):
237
  raise ValueError("Error no video input")
238
  print(video_file_path)
239
  try:
 
259
  except Exception as e:
260
  raise RuntimeError("Error converting video to audio")
261
 
262
+ try:
 
263
 
264
  df = pd.DataFrame(columns = ['start','end','text'])
265
  srt_path = str(video_file_path.replace(file_ending, ".wav")) + ".srt"
 
301
 
302
  def translate_transcriptions(df, selected_translation_lang_2):
303
  if selected_translation_lang_2 is None:
304
+ selected_translation_lang_2 = 'English'
305
  df.reset_index(inplace=True)
306
 
307
  print("start_translation")