liuhuadai commited on
Commit
da35ba6
·
verified ·
1 Parent(s): ff51342

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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.t5_model.to('cuda')
272
  text_features = model.encode_t5_text([caption])
273
  info['text_features'] = text_features[0].cpu()
274
- model.t5_model.to('cpu')
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 = []