hysts HF staff commited on
Commit
adfea12
1 Parent(s): 62f5cce
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -3,6 +3,7 @@
3
  from __future__ import annotations
4
 
5
  import os
 
6
  import shlex
7
  import subprocess
8
 
@@ -27,6 +28,8 @@ pipe = pipeline('text-to-video-synthesis', 'damo/text-to-video-synthesis')
27
 
28
 
29
  def generate(prompt: str, seed: int) -> str:
 
 
30
  torch.manual_seed(seed)
31
  return pipe({'text': prompt})[OutputKeys.OUTPUT_VIDEO]
32
 
 
3
  from __future__ import annotations
4
 
5
  import os
6
+ import random
7
  import shlex
8
  import subprocess
9
 
 
28
 
29
 
30
  def generate(prompt: str, seed: int) -> str:
31
+ if seed == -1:
32
+ seed = random.randint(0, 1000000)
33
  torch.manual_seed(seed)
34
  return pipe({'text': prompt})[OutputKeys.OUTPUT_VIDEO]
35