Spanicin commited on
Commit
7559c5b
·
verified ·
1 Parent(s): b9c9d91

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -21,7 +21,8 @@ from torch.cuda.amp import autocast
21
  # Initialize the Flask app
22
  app = Flask(__name__)
23
  TEMP_DIR = None
24
- VIDEO_DIRECTORY = None
 
25
 
26
  def clear_cuda_memory():
27
  torch.cuda.empty_cache()
@@ -207,8 +208,8 @@ def generate_video():
207
  # Return the output video path or further process the file for download
208
  if final_output_video and final_output_video.endswith('.mp4'):
209
  filename = os.path.basename(final_output_video)
210
- os.makedirs('videos', exist_ok=True)
211
- VIDEO_DIRECTORY = os.path.abspath('videos')
212
  print("VIDEO_DIRECTORY: ",VIDEO_DIRECTORY)
213
  destination_path = os.path.join(VIDEO_DIRECTORY, filename)
214
  shutil.copy(final_output_video, destination_path)
 
21
  # Initialize the Flask app
22
  app = Flask(__name__)
23
  TEMP_DIR = None
24
+ VIDEO_DIRECTORY = os.path.abspath("videos")
25
+ os.makedirs(VIDEO_DIRECTORY, exist_ok=True)
26
 
27
  def clear_cuda_memory():
28
  torch.cuda.empty_cache()
 
208
  # Return the output video path or further process the file for download
209
  if final_output_video and final_output_video.endswith('.mp4'):
210
  filename = os.path.basename(final_output_video)
211
+ # os.makedirs('videos', exist_ok=True)
212
+ # VIDEO_DIRECTORY = os.path.abspath('videos')
213
  print("VIDEO_DIRECTORY: ",VIDEO_DIRECTORY)
214
  destination_path = os.path.join(VIDEO_DIRECTORY, filename)
215
  shutil.copy(final_output_video, destination_path)