Smriti77 commited on
Commit
2e6e2e9
·
verified ·
1 Parent(s): 76f1aae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -144,7 +144,7 @@ def refine_sentence_with_deepseek(text):
144
 
145
  except Exception as e:
146
  print(f"Error with DeepSeek API: {str(e)}")
147
- # Fallback to basic word filtering
148
  words = text.split()
149
  filtered_words = [w for w in words if w.lower() not in ['a', 'an', 'the', 'is', 'are', 'am']]
150
  return ' '.join(filtered_words)
@@ -202,14 +202,14 @@ def retrieve_video(text, debug=False, similarity_threshold=0.7):
202
  return None
203
 
204
  def merge_videos(video_list, output_path="temp/output.mp4"):
205
- # Create temp directory
206
  os.makedirs("temp", exist_ok=True)
207
 
208
  if not video_list:
209
  return None
210
 
211
  if len(video_list) == 1:
212
- # Use a try-except block to handle potential errors
213
  try:
214
  import shutil
215
  shutil.copy(video_list[0], output_path)
@@ -230,7 +230,7 @@ def merge_videos(video_list, output_path="temp/output.mp4"):
230
  print("No valid video paths found")
231
  return None
232
 
233
- # Create the video list file
234
  list_path = "temp/video_list.txt"
235
  with open(list_path, "w") as f:
236
  for path in verified_paths:
 
144
 
145
  except Exception as e:
146
  print(f"Error with DeepSeek API: {str(e)}")
147
+
148
  words = text.split()
149
  filtered_words = [w for w in words if w.lower() not in ['a', 'an', 'the', 'is', 'are', 'am']]
150
  return ' '.join(filtered_words)
 
202
  return None
203
 
204
  def merge_videos(video_list, output_path="temp/output.mp4"):
205
+
206
  os.makedirs("temp", exist_ok=True)
207
 
208
  if not video_list:
209
  return None
210
 
211
  if len(video_list) == 1:
212
+
213
  try:
214
  import shutil
215
  shutil.copy(video_list[0], output_path)
 
230
  print("No valid video paths found")
231
  return None
232
 
233
+
234
  list_path = "temp/video_list.txt"
235
  with open(list_path, "w") as f:
236
  for path in verified_paths: