BoldActionMan commited on
Commit
9893e0a
·
verified ·
1 Parent(s): 7ebe9cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -55,6 +55,9 @@ def process_video(video_file, language_choice):
55
  print(sttresult["text"])
56
  print(sttresult["language"])
57
 
 
 
 
58
  # Get the segments with start and end times
59
  segments = sttresult['segments']
60
 
@@ -215,7 +218,7 @@ language_choices = ts.get_languages("google")["en"]
215
  gr.Interface(
216
  fn=gradio_interface,
217
  inputs=[
218
- gr.Video(label="Upload Video"),
219
  gr.Dropdown(choices=language_choices, label="Choose Language for Translation")
220
  ],
221
  outputs=gr.Video(label="Translated Video"),
 
55
  print(sttresult["text"])
56
  print(sttresult["language"])
57
 
58
+ if sttresult["language"] == language_choice:
59
+ return video_file
60
+
61
  # Get the segments with start and end times
62
  segments = sttresult['segments']
63
 
 
218
  gr.Interface(
219
  fn=gradio_interface,
220
  inputs=[
221
+ gr.Video(label="Upload Video", sources=['upload']),
222
  gr.Dropdown(choices=language_choices, label="Choose Language for Translation")
223
  ],
224
  outputs=gr.Video(label="Translated Video"),