MCPcopy Create free account
hub / github.com/IceClear/StableSR / setup

Method setup

predict.py:28–41  ·  view source on GitHub ↗

Load the model into memory to make running multiple predictions efficient

(self)

Source from the content-addressed store, hash-verified

26
27class 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,

Callers

nothing calls this directly

Calls 2

loadMethod · 0.80
load_model_from_configFunction · 0.70

Tested by

no test coverage detected