jschwab21 commited on
Commit
eea176b
·
verified ·
1 Parent(s): 5ff01ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -47,11 +47,18 @@ class CustomTheme(Base):
47
 
48
  custom_theme = CustomTheme()
49
 
 
 
 
 
 
 
50
  def display_results(video_url, video_file, description):
51
  if video_url:
52
  final_clip_path = process_video(video_url, description, is_url=True)
53
  elif video_file:
54
- final_clip_path = process_video(video_file.name, description, is_url=False)
 
55
  else:
56
  return "No video provided", None
57
 
 
47
 
48
  custom_theme = CustomTheme()
49
 
50
+ def save_uploaded_file(file):
51
+ file_path = f"uploaded_videos/{file.orig_name}"
52
+ with open(file_path, "wb") as f:
53
+ f.write(file.read())
54
+ return file_path
55
+
56
  def display_results(video_url, video_file, description):
57
  if video_url:
58
  final_clip_path = process_video(video_url, description, is_url=True)
59
  elif video_file:
60
+ video_file_path = save_uploaded_file(video_file)
61
+ final_clip_path = process_video(video_file_path, description, is_url=False)
62
  else:
63
  return "No video provided", None
64