MCPcopy Create free account
hub / github.com/InternScience/SciReason / __init__

Method __init__

opencompass/models/mixtral.py:25–45  ·  view source on GitHub ↗
(
        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,
    )

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 4

_load_tokenizerMethod · 0.95
_load_modelMethod · 0.95
APITemplateParserClass · 0.90
get_loggerFunction · 0.90

Tested by

no test coverage detected