MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / __init__

Method __init__

bmtools/models/cpmbee_model.py:18–27  ·  view source on GitHub ↗
(self, config_path: str, ckpt_path: str, device: str="cuda")

Source from the content-addressed store, hash-verified

16 model: CPMBeeTorch = None
17
18 def __init__(self, config_path: str, ckpt_path: str, device: str="cuda") -> None:
19 super().__init__()
20 self.model_name = ckpt_path
21 self.config = CPMBeeConfig.from_json_file(config_path)
22 self.tokenizer = CPMBeeTokenizer()
23 self.model = CPMBeeTorch(config=self.config)
24
25 self.model.load_state_dict(torch.load(ckpt_path))
26 if device == "cuda":
27 self.model.cuda()
28
29 @property
30 def _llm_type(self) -> str:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected