MCPcopy Create free account
hub / github.com/LargeWorldModel/LWM / __init__

Method __init__

lwm/vqgan.py:15–24  ·  view source on GitHub ↗
(self, vqgan_checkpoint, replicate=False)

Source from the content-addressed store, hash-verified

13
14class VQGAN:
15 def __init__(self, vqgan_checkpoint, replicate=False):
16 assert vqgan_checkpoint != ''
17 self.replicate = replicate
18 self.config = VQGANConfig.get_default_config()
19 self.params = pickle.load(open_file(vqgan_checkpoint, 'rb'))
20 if replicate:
21 self.params = jax_utils.replicate(self.params)
22 else:
23 self.params = jax.jit(lambda x: x)(self.params)
24 self.model = VQGANModel(self.config)
25
26 def _wrap_fn(self, fn):
27 if self.replicate:

Callers

nothing calls this directly

Calls 2

VQGANModelClass · 0.85
get_default_configMethod · 0.45

Tested by

no test coverage detected