27 lines
664 B
Python
27 lines
664 B
Python
import os
|
|
import torch
|
|
from functools import wraps
|
|
|
|
_orig_load = torch.load
|
|
|
|
@wraps(_orig_load)
|
|
def _load_patch(*args, **kwargs):
|
|
kwargs.setdefault("weights_only", False)
|
|
return _orig_load(*args, **kwargs)
|
|
|
|
torch.load = _load_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)
|
|
|
|
test_text = {
|
|
'text': 'A panda eating bamboo on a rock.',
|
|
}
|
|
output_video_path = p(test_text, output_video='./output.mp4')[OutputKeys.OUTPUT_VIDEO]
|
|
print('output_video_path:', output_video_path)
|
|
|