(self, config_path: str, ckpt_path: str, device: str="cuda")
| 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: |
nothing calls this directly
no outgoing calls
no test coverage detected