MCPcopy Create free account
hub / github.com/AMAP-ML/EMF / ar_sample

Method ar_sample

tok/mm_autoencoder.py:20–29  ·  view source on GitHub ↗
(self, x, args)

Source from the content-addressed store, hash-verified

18 self.decoder = VQVAE.from_checkpoint(decoder_path, **decoder_args)
19
20 def ar_sample(self, x, args):
21 x = self.ar_model.sample(
22 x,
23 cfg_scale=args.get('cfg_scale', 1.0),
24 cfg_interval=args.get('cfg_interval', -1),
25 temperature=args.get('temperature', 1.0),
26 top_k=args.get('top_k', 0),
27 top_p=args.get('top_p', 1.0)
28 )
29 return x
30
31 def post_process(self, x):
32 x = x.cpu().float().clamp(0., 1.) * 255.

Callers 2

forwardMethod · 0.95

Calls 1

sampleMethod · 0.80

Tested by

no test coverage detected