MCPcopy Create free account
hub / github.com/chenfei-wu/TaskMatrix / load_model

Method load_model

visual_chatgpt.py:1059–1067  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1057 return image_pil, image
1058
1059 def load_model(self):
1060 args = SLConfig.fromfile(self.model_config_path)
1061 args.device = self.device
1062 model = build_model(args)
1063 checkpoint = torch.load(self.model_checkpoint_path, map_location="cpu")
1064 load_res = model.load_state_dict(clean_state_dict(checkpoint["model"]), strict=False)
1065 print(load_res)
1066 _ = model.eval()
1067 return model
1068
1069 def get_grounding_boxes(self, image, caption, with_logits=True):
1070 caption = caption.lower()

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected