(vae_trt, cfg_denoiser, diffusion, val_data, clip_model,
history_motion, abs_pose, future_len, history_len, cfg)
| 77 | |
| 78 | |
| 79 | def warmup(vae_trt, cfg_denoiser, diffusion, val_data, clip_model, |
| 80 | history_motion, abs_pose, future_len, history_len, cfg): |
| 81 | logger.info("Warming up...") |
| 82 | text_embedding = get_text_embedding("stand", clip_model, cfg.device) |
| 83 | future_motion, motion_dict, abs_pose = generate_next_motion( |
| 84 | vae=vae_trt, |
| 85 | denoiser=cfg_denoiser, |
| 86 | diffusion=diffusion, |
| 87 | val_data=val_data, |
| 88 | text_embedding=text_embedding, |
| 89 | history_motion=history_motion, |
| 90 | abs_pose=abs_pose, |
| 91 | future_len=future_len, |
| 92 | # cfg=cfg, |
| 93 | use_full_sample=cfg.use_full_sample, |
| 94 | guidance_scale=cfg.guidance_scale, |
| 95 | ) |
| 96 | # 因为第一次和第二次, history_motion的stride内存布局不一样, 会重新触发编译 |
| 97 | |
| 98 | # print(f"First history_motion strides: {history_motion.stride()}") |
| 99 | # print( |
| 100 | # f"Second history_motion strides: {future_motion[:, -history_len:, :].stride()}" |
| 101 | # ) |
| 102 | history_motion = future_motion[:, -history_len:, :] |
| 103 | future_motion, motion_dict, abs_pose = generate_next_motion( |
| 104 | vae=vae_trt, |
| 105 | denoiser=cfg_denoiser, |
| 106 | diffusion=diffusion, |
| 107 | val_data=val_data, |
| 108 | text_embedding=text_embedding, |
| 109 | history_motion=history_motion, |
| 110 | abs_pose=abs_pose, |
| 111 | future_len=future_len, |
| 112 | # cfg=cfg, |
| 113 | use_full_sample=cfg.use_full_sample, |
| 114 | guidance_scale=cfg.guidance_scale, |
| 115 | ) |
| 116 | logger.info("Warming up done") |
| 117 | |
| 118 | |
| 119 | @pdb_decorator |
nothing calls this directly
no test coverage detected