Spaces:
Running
on
Zero
Running
on
Zero
sandesh-bharadwaj
commited on
Commit
•
edfa491
1
Parent(s):
4008489
Fixes for ZeroGPU compatibility
Browse files- app.py +2 -0
- environment.yml +2 -1
- requirements.txt +2 -1
app.py
CHANGED
@@ -3,6 +3,7 @@ from engine import DescribeVideo, GenerateAudio
|
|
3 |
from moviepy.editor import VideoFileClip, AudioFileClip, CompositeAudioClip
|
4 |
from moviepy.audio.fx.volumex import volumex
|
5 |
import shutil, tempfile, os
|
|
|
6 |
|
7 |
# Maps for model selection based on user input
|
8 |
video_model_map = {
|
@@ -115,6 +116,7 @@ def generate_video_description(video_descriptor, google_api_key, toggle_advanced
|
|
115 |
raise gr.Error("Exception raised: ", e)
|
116 |
|
117 |
# Function to generate music based on the video description
|
|
|
118 |
def generate_music(music_generator, music_prompt, num_samples):
|
119 |
global video_duration, audio_paths, session_dir
|
120 |
try:
|
|
|
3 |
from moviepy.editor import VideoFileClip, AudioFileClip, CompositeAudioClip
|
4 |
from moviepy.audio.fx.volumex import volumex
|
5 |
import shutil, tempfile, os
|
6 |
+
import spaces
|
7 |
|
8 |
# Maps for model selection based on user input
|
9 |
video_model_map = {
|
|
|
116 |
raise gr.Error("Exception raised: ", e)
|
117 |
|
118 |
# Function to generate music based on the video description
|
119 |
+
@spaces.GPU
|
120 |
def generate_music(music_generator, music_prompt, num_samples):
|
121 |
global video_duration, audio_paths, session_dir
|
122 |
try:
|
environment.yml
CHANGED
@@ -161,7 +161,7 @@ dependencies:
|
|
161 |
- prompt-toolkit==3.0.47
|
162 |
- proto-plus==1.24.0
|
163 |
- protobuf==4.25.3
|
164 |
-
- psutil==
|
165 |
- ptyprocess==0.7.0
|
166 |
- pure-eval==0.2.3
|
167 |
- pyarrow==16.1.0
|
@@ -201,6 +201,7 @@ dependencies:
|
|
201 |
- soundfile==0.12.1
|
202 |
- soupsieve==2.5
|
203 |
- soxr==0.3.7
|
|
|
204 |
- spacy==3.7.5
|
205 |
- spacy-legacy==3.0.12
|
206 |
- spacy-loggers==1.0.5
|
|
|
161 |
- prompt-toolkit==3.0.47
|
162 |
- proto-plus==1.24.0
|
163 |
- protobuf==4.25.3
|
164 |
+
- psutil==5.9.8
|
165 |
- ptyprocess==0.7.0
|
166 |
- pure-eval==0.2.3
|
167 |
- pyarrow==16.1.0
|
|
|
201 |
- soundfile==0.12.1
|
202 |
- soupsieve==2.5
|
203 |
- soxr==0.3.7
|
204 |
+
- spaces==0.29.3
|
205 |
- spacy==3.7.5
|
206 |
- spacy-legacy==3.0.12
|
207 |
- spacy-loggers==1.0.5
|
requirements.txt
CHANGED
@@ -137,7 +137,7 @@ proglog==0.1.10
|
|
137 |
prompt_toolkit==3.0.47
|
138 |
proto-plus==1.24.0
|
139 |
protobuf==4.25.3
|
140 |
-
psutil==
|
141 |
ptyprocess==0.7.0
|
142 |
pure_eval==0.2.3
|
143 |
pyarrow==16.1.0
|
@@ -177,6 +177,7 @@ sniffio==1.3.1
|
|
177 |
soundfile==0.12.1
|
178 |
soupsieve==2.5
|
179 |
soxr==0.3.7
|
|
|
180 |
spacy==3.7.5
|
181 |
spacy-legacy==3.0.12
|
182 |
spacy-loggers==1.0.5
|
|
|
137 |
prompt_toolkit==3.0.47
|
138 |
proto-plus==1.24.0
|
139 |
protobuf==4.25.3
|
140 |
+
psutil==5.9.8
|
141 |
ptyprocess==0.7.0
|
142 |
pure_eval==0.2.3
|
143 |
pyarrow==16.1.0
|
|
|
177 |
soundfile==0.12.1
|
178 |
soupsieve==2.5
|
179 |
soxr==0.3.7
|
180 |
+
spaces==0.29.3
|
181 |
spacy==3.7.5
|
182 |
spacy-legacy==3.0.12
|
183 |
spacy-loggers==1.0.5
|