Spaces:
Sleeping
Sleeping
duration
Browse files2 unmodified lines345678910111213141516171819202122232432 unmodified lines57585960616263646566676869702 unmodified linesos.environ["GRADIO_TEMP_DIR"] = os.path.join(os.getcwd(), ".tmp_outputs")os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"import loggingimport uuidimport GPUtilimport gradio as grimport psutilimport spacesimport torchfrom videosys import CogVideoXConfig, CogVideoXPABConfig, VideoSysEnginelogging.basicConfig(level=logging.INFO)logger = logging.getLogger(__name__)dtype = torch.float16def load_model(enable_video_sys=False, pab_threshold=[100, 850], pab_range=2):pab_config = CogVideoXPABConfig(spatial_threshold=pab_threshold, spatial_range=pab_range)32 unmodified linesreturn {"cpu": f"{cpu_percent}%", "memory": f"{memory.percent}%", "disk": f"{disk.percent}%", "gpu": gpu_info}@spaces.GPU(duration=120)def generate_vanilla(prompt, num_inference_steps, guidance_scale, progress=gr.Progress(track_tqdm=True)):engine = load_model()video_path = generate(engine, prompt, num_inference_steps, guidance_scale)return video_path@spaces.GPU(duration=120)def generate_vs(prompt,num_inference_steps,2 unmodified lines3456789101112131415161732 unmodified lines50515253545556575859606162632 unmodified linesos.environ["GRADIO_TEMP_DIR"] = os.path.join(os.getcwd(), ".tmp_outputs")os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"import uuidimport GPUtilimport gradio as grimport psutilimport spacesfrom videosys import CogVideoXConfig, CogVideoXPABConfig, VideoSysEnginedef load_model(enable_video_sys=False, pab_threshold=[100, 850], pab_range=2):pab_config = CogVideoXPABConfig(spatial_threshold=pab_threshold, spatial_range=pab_range)32 unmodified linesreturn {"cpu": f"{cpu_percent}%", "memory": f"{memory.percent}%", "disk": f"{disk.percent}%", "gpu": gpu_info}@spaces.GPU(duration=240)def generate_vanilla(prompt, num_inference_steps, guidance_scale, progress=gr.Progress(track_tqdm=True)):engine = load_model()video_path = generate(engine, prompt, num_inference_steps, guidance_scale)return video_path@spaces.GPU(duration=240)def generate_vs(prompt,num_inference_steps,
app.py+2-9