17 lines
563 B
Python
17 lines
563 B
Python
import os
|
|
import torch
|
|
device = "cuda" if torch.cuda.is_available() else "npu"
|
|
import patch
|
|
|
|
from modelscope.pipelines import pipeline
|
|
from modelscope.outputs import OutputKeys
|
|
|
|
model_path = "/mnt/contest_ceph/zhanghao/models/iic/text-to-video-synthesis"
|
|
p = pipeline('text-to-video-synthesis', model_path, device=device)
|
|
|
|
test_text = {
|
|
'text': 'A panda eating a burger and french fries on a rock.',
|
|
}
|
|
output_video_path = p(test_text, device=device, output_video='./output.mp4')[OutputKeys.OUTPUT_VIDEO]
|
|
print('output_video_path:', output_video_path)
|