MCPcopy Index your code
hub / github.com/CompVis/zigma / get_model

Function get_model

utils/train_utils.py:41–56  ·  view source on GitHub ↗
(args, device)

Source from the content-addressed store, hash-verified

39
40
41def get_model(args, device):
42 if args.is_latent:
43 # Create model:
44 assert (
45 args.data.image_size % 8 == 0
46 ), "Image size must be divisible by 8 (for the VAE encoder)."
47 in_channels = 4
48 input_size = args.data.image_size // 8
49 else:
50 in_channels = 3
51 input_size = args.data.image_size
52 logging.info(f"input_size: {input_size}, in_channels: {in_channels}")
53
54 model = instantiate_from_config(args.model).to(device)
55
56 return model, in_channels, input_size
57
58
59def create_logger(rank, logging_dir=None):

Callers 2

mainFunction · 0.90
mainFunction · 0.90

Calls 2

instantiate_from_configFunction · 0.85
toMethod · 0.80

Tested by

no test coverage detected