(self, videos)
| 511 | return_tokenizer=False) |
| 512 | |
| 513 | def forward(self, videos): |
| 514 | # preprocess |
| 515 | size = (self.model.image_size,) * 2 |
| 516 | videos = torch.cat([ |
| 517 | F.interpolate( |
| 518 | u.transpose(0, 1), |
| 519 | size=size, |
| 520 | mode='bicubic', |
| 521 | align_corners=False) for u in videos |
| 522 | ]) |
| 523 | videos = self.transforms.transforms[-1](videos.mul_(0.5).add_(0.5)) |
| 524 | |
| 525 | # forward |
| 526 | with torch.cuda.amp.autocast(dtype=self.dtype): |
| 527 | out = self.model.visual(videos, use_31_block=True) |
| 528 | return out |
| 529 | |
| 530 | @classmethod |
| 531 | def from_pretrained(cls, pretrained_model_path, transformer_additional_kwargs={}): |
nothing calls this directly
no outgoing calls
no test coverage detected