Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -268,10 +268,10 @@ def extract_features_gpu(clip_chunk, sync_chunk, caption):
|
|
| 268 |
info = {}
|
| 269 |
with torch.no_grad():
|
| 270 |
|
| 271 |
-
model.
|
| 272 |
text_features = model.encode_t5_text([caption])
|
| 273 |
info['text_features'] = text_features[0].cpu()
|
| 274 |
-
model.
|
| 275 |
|
| 276 |
|
| 277 |
model.synchformer.to('cuda')
|
|
@@ -381,7 +381,7 @@ def generate_audio_core(video_file, caption):
|
|
| 381 |
return "❌ Please upload a video file first.", None
|
| 382 |
|
| 383 |
if not caption or caption.strip() == "":
|
| 384 |
-
caption="
|
| 385 |
|
| 386 |
caption = caption.strip()
|
| 387 |
logs = []
|
|
|
|
| 268 |
info = {}
|
| 269 |
with torch.no_grad():
|
| 270 |
|
| 271 |
+
model.t5.to('cuda')
|
| 272 |
text_features = model.encode_t5_text([caption])
|
| 273 |
info['text_features'] = text_features[0].cpu()
|
| 274 |
+
model.t5.to('cpu')
|
| 275 |
|
| 276 |
|
| 277 |
model.synchformer.to('cuda')
|
|
|
|
| 381 |
return "❌ Please upload a video file first.", None
|
| 382 |
|
| 383 |
if not caption or caption.strip() == "":
|
| 384 |
+
caption="generate"
|
| 385 |
|
| 386 |
caption = caption.strip()
|
| 387 |
logs = []
|