Libra7578 commited on
Commit
5709395
1 Parent(s): c5c08d2

Create app.py

Browse files

Let’s make videos together!

Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import snapshot_download
2
+
3
+ from modelscope.pipelines import pipeline
4
+ from modelscope.outputs import OutputKeys
5
+ import pathlib
6
+
7
+ model_dir = pathlib.Path('weights')
8
+ snapshot_download('damo-vilab/modelscope-damo-text-to-video-synthesis',
9
+ repo_type='model', local_dir=model_dir)
10
+
11
+ pipe = pipeline('text-to-video-synthesis', model_dir.as_posix())
12
+ test_text = {
13
+ 'text': 'A panda eating bamboo on a rock.',
14
+ }
15
+ output_video_path = pipe(test_text,)[OutputKeys.OUTPUT_VIDEO]
16
+ print('output_video_path:', output_video_path)
17
+