Download repos/TeaCache/eval/teacache/experiments/utils.py from Cccccz/comparison: direct link, hf CLI and curl.
- Browser
- Download file 638 Bytes
-
https://huggingface.co/Cccccz/comparison/resolve/main/repos/TeaCache/eval/teacache/experiments/utils.py
- Command line
-
hf download hf://Cccccz/comparison/repos/TeaCache/eval/teacache/experiments/utils.py
-
curl -L -o utils.py https://huggingface.co/Cccccz/comparison/resolve/main/repos/TeaCache/eval/teacache/experiments/utils.py
638 Bytes
| import json | |
| import os | |
| import tqdm | |
| from videosys.utils.utils import set_seed | |
| def generate_func(pipeline, prompt_list, output_dir, loop: int = 5, kwargs: dict = {}): | |
| kwargs["verbose"] = False | |
| for prompt in tqdm.tqdm(prompt_list): | |
| for l in range(loop): | |
| video = pipeline.generate(prompt, seed=l, **kwargs).video[0] | |
| pipeline.save_video(video, os.path.join(output_dir, f"{prompt}-{l}.mp4")) | |
| def read_prompt_list(prompt_list_path): | |
| with open(prompt_list_path, "r") as f: | |
| prompt_list = json.load(f) | |
| prompt_list = [prompt["prompt_en"] for prompt in prompt_list] | |
| return prompt_list | |