artificialguybr commited on
Commit
8e84c68
1 Parent(s): 6783c16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -14
app.py CHANGED
@@ -31,20 +31,6 @@ model_size = "small"
31
  model = WhisperModel(model_size, device="cuda", compute_type="int8")
32
 
33
  def process_video(radio, video, target_language):
34
- video_duration = 0.0
35
- if radio == "Upload":
36
- video_info = ffmpeg.probe(video)
37
- if 'duration' in video_info['streams'][0]:
38
- video_duration = float(video_info['streams'][0]['duration'])
39
- else: # Handle webcam video
40
- try:
41
- video_info = ffmpeg.probe(video)
42
- print("Webcam Video Info:", video_info)
43
- except Exception as e:
44
- print("Error probing webcam video:", e)
45
-
46
- if video_duration > 90:
47
- return gr.Interface.Warnings("Video duration exceeds 1 minute and 30 seconds. Please upload a shorter video.")
48
  if target_language is None:
49
  return gr.Interface.Warnings("Please select a Target Language for Dubbing.")
50
 
 
31
  model = WhisperModel(model_size, device="cuda", compute_type="int8")
32
 
33
  def process_video(radio, video, target_language):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  if target_language is None:
35
  return gr.Interface.Warnings("Please select a Target Language for Dubbing.")
36