(self, path="nulltext.npy")
| 31 | self.init_uncond() |
| 32 | |
| 33 | def init_uncond(self, path="nulltext.npy"): |
| 34 | try: |
| 35 | assert os.path.exists(path), f"Uncond file {path} not found." |
| 36 | print(f"Loading uncond from {path}") |
| 37 | uncond = torch.from_numpy(np.load(path)) |
| 38 | self.register_buffer("uncond", uncond) |
| 39 | except: |
| 40 | self.uncond = None |
| 41 | |
| 42 | def preprocess(self, x): |
| 43 | # resize to 224, normalize to [0,1] and re-normalize according to clip |
no test coverage detected