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
| 10 | |
| 11 | @dataclass(frozen=True) |
| 12 | class 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 | |
| 34 | def construct_llm_config(args: argparse.Namespace) -> LMConfig: |
no outgoing calls
no test coverage detected