Load the model into memory to make running multiple predictions efficient
(self)
| 26 | |
| 27 | class Predictor(BasePredictor): |
| 28 | def setup(self) -> None: |
| 29 | """Load the model into memory to make running multiple predictions efficient""" |
| 30 | config = OmegaConf.load("configs/stableSRNew/v2-finetune_text_T_512.yaml") |
| 31 | self.model = load_model_from_config(config, "stablesr_000117.ckpt") |
| 32 | device = torch.device("cuda") |
| 33 | |
| 34 | self.model.configs = config |
| 35 | self.model = self.model.to(device) |
| 36 | |
| 37 | vqgan_config = OmegaConf.load( |
| 38 | "configs/autoencoder/autoencoder_kl_64x64x4_resi.yaml" |
| 39 | ) |
| 40 | self.vq_model = load_model_from_config(vqgan_config, "vqgan_cfw_00011.ckpt") |
| 41 | self.vq_model = self.vq_model.to(device) |
| 42 | |
| 43 | def predict( |
| 44 | self, |
nothing calls this directly
no test coverage detected