MCPcopy Create free account
hub / github.com/THUDM/AutoWebGLM / LMConfig

Class LMConfig

webarena/llms/lm_config.py:12–31  ·  view source on GitHub ↗

A config for a language model. Attributes: provider: The name of the API provider. model: The name of the model. model_cls: The Python class corresponding to the model, mostly for Hugging Face transformers. tokenizer_cls: The Python class correspondi

Source from the content-addressed store, hash-verified

10
11@dataclass(frozen=True)
12class LMConfig:
13 """A config for a language model.
14
15 Attributes:
16 provider: The name of the API provider.
17 model: The name of the model.
18 model_cls: The Python class corresponding to the model, mostly for
19 Hugging Face transformers.
20 tokenizer_cls: The Python class corresponding to the tokenizer, mostly
21 for Hugging Face transformers.
22 mode: The mode of the API calls, e.g., "chat" or "generation".
23 """
24
25 provider: str
26 model: str
27 model_cls: type | None = None
28 tokenizer_cls: type | None = None
29 mode: str | None = None
30 gen_config: dict[str, Any] = dataclasses.field(default_factory=dict)
31 cuda: str = '0'
32
33
34def construct_llm_config(args: argparse.Namespace) -> LMConfig:

Callers 1

construct_llm_configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected