(
self,
path: str,
max_seq_len: int = 2048,
max_batch_size: int = 8,
tokenizer_only: bool = False,
tokenizer_path: Optional[str] = None,
meta_template: Optional[Dict] = None,
num_gpus: int = 2,
)
| 23 | """ |
| 24 | |
| 25 | def __init__( |
| 26 | self, |
| 27 | path: str, |
| 28 | max_seq_len: int = 2048, |
| 29 | max_batch_size: int = 8, |
| 30 | tokenizer_only: bool = False, |
| 31 | tokenizer_path: Optional[str] = None, |
| 32 | meta_template: Optional[Dict] = None, |
| 33 | num_gpus: int = 2, |
| 34 | ): # noqa |
| 35 | if tokenizer_only: |
| 36 | self._load_tokenizer(tokenizer_path=tokenizer_path) |
| 37 | else: |
| 38 | self._load_model(path=path, |
| 39 | max_seq_len=max_seq_len, |
| 40 | max_batch_size=max_batch_size, |
| 41 | tokenizer_path=tokenizer_path, |
| 42 | num_gpus=num_gpus) |
| 43 | self.max_seq_len = max_seq_len |
| 44 | self.template_parser = APITemplateParser(meta_template) |
| 45 | self.logger = get_logger() |
| 46 | |
| 47 | def _load_model(self, |
| 48 | path: str, |
nothing calls this directly
no test coverage detected