MCPcopy Index your code
hub / github.com/CompVis/diff2flow / init_uncond

Method init_uncond

diff2flow/conditioning/encoders.py:33–40  ·  view source on GitHub ↗
(self, path="nulltext.npy")

Source from the content-addressed store, hash-verified

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

Callers 1

__init__Method · 0.95

Calls 1

register_bufferMethod · 0.80

Tested by

no test coverage detected