sheikhed commited on
Commit
4aa1838
·
verified ·
1 Parent(s): 96e2b62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -98,12 +98,14 @@ def combine_audio_video(video_path, audio_path, output_path):
98
 
99
  subprocess.run(cmd, check=True)
100
 
101
- def process_video(model, audio_file, progress=gr.Progress()):
 
 
 
102
  session_id = str(uuid.uuid4()) # Generate a unique session ID
103
 
104
  progress(0.2, desc="Processing video...")
105
  video_path = os.path.join("models", model)
106
- audio_path = audio_file.name # Get the path of the uploaded audio file
107
 
108
  try:
109
  progress(0.3, desc="Uploading files...")
 
98
 
99
  subprocess.run(cmd, check=True)
100
 
101
+ def process_video(model, audio_path, progress=gr.Progress()):
102
+ if not audio_path:
103
+ return None, "No audio file provided"
104
+
105
  session_id = str(uuid.uuid4()) # Generate a unique session ID
106
 
107
  progress(0.2, desc="Processing video...")
108
  video_path = os.path.join("models", model)
 
109
 
110
  try:
111
  progress(0.3, desc="Uploading files...")