sreepathi-ravikumar commited on
Commit
a9a000b
·
verified ·
1 Parent(s): 7a643e7

Update video2.py

Browse files
Files changed (1) hide show
  1. video2.py +6 -3
video2.py CHANGED
@@ -5,14 +5,17 @@ import numpy as np
5
  from gtts import gTTS
6
  from mutagen.mp3 import MP3
7
  import os
 
8
 
9
- BASE_DIR = "/home/user/app/tmp" # Hugging Face allows writes here
 
10
  IMAGE_DIR = os.path.join(BASE_DIR, "images")
11
  AUDIO_DIR = os.path.join(BASE_DIR, "sound")
12
  CLIPS_DIR = os.path.join(BASE_DIR, "video")
13
 
14
- for path in [IMAGE_DIR, AUDIO_DIR, CLIPS_DIR]:
15
- os.makedirs(path, exist_ok=True)
 
16
 
17
 
18
  # Generate audio
 
5
  from gtts import gTTS
6
  from mutagen.mp3 import MP3
7
  import os
8
+ from pathlib import Path
9
 
10
+ # Use /app/data which we created with proper permissions
11
+ BASE_DIR = "/app/data"
12
  IMAGE_DIR = os.path.join(BASE_DIR, "images")
13
  AUDIO_DIR = os.path.join(BASE_DIR, "sound")
14
  CLIPS_DIR = os.path.join(BASE_DIR, "video")
15
 
16
+ # Create directories (no chmod needed)
17
+ for path in [BASE_DIR, IMAGE_DIR, AUDIO_DIR, CLIPS_DIR]:
18
+ Path(path).mkdir(parents=True, exist_ok=True)
19
 
20
 
21
  # Generate audio