killian31 commited on
Commit
6c05ea2
·
1 Parent(s): 0a8ffcc

fix versions

Browse files
Files changed (2) hide show
  1. app.py +6 -2
  2. requirements.txt +5 -5
app.py CHANGED
@@ -29,8 +29,12 @@ def generate_srt_file(transcription_result, srt_file_path, lag=0):
29
  def generate_video(
30
  audio_path, video_path, input, language, lag, progress=gr.Progress(track_tqdm=True)
31
  ):
32
-
33
- # Check if the input is a video
 
 
 
 
34
  progress(0.0, "Checking input...")
35
  if input == "Video":
36
  progress(0.0, "Extracting audio from video...")
 
29
  def generate_video(
30
  audio_path, video_path, input, language, lag, progress=gr.Progress(track_tqdm=True)
31
  ):
32
+ if audio_path is None and video_path is None:
33
+ raise ValueError("Please upload an audio or video file.")
34
+ if input == "Video" and video_path is None:
35
+ raise ValueError("Please upload a video file.")
36
+ if input == "Audio" and audio_path is None:
37
+ raise ValueError("Please upload an audio file.")
38
  progress(0.0, "Checking input...")
39
  if input == "Video":
40
  progress(0.0, "Extracting audio from video...")
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
- gradio
2
- moviepy
3
- numpy
4
- openai_whisper
5
- torch
 
1
+ gradio==5.1.0
2
+ moviepy==1.0.3
3
+ numpy==1.23.5
4
+ openai_whisper==20240930
5
+ torch==2.2.2