View on GitHub
"```python\nfrom modal_training_gym.common.models.base import HFModelConfiguration\n```\n\nModelConfig for models hosted on HuggingFace.\n\nImplements `download()` via `huggingface_hub.snapshot_download`\nusing `self.model_name` as the repo ID. An empty `model_path` is\nseeded from the snapshot; a populated one already holds the weights to\nload and is left untouched.\n\n**Inherits from:** `ModelConfig`\n\n## Constructor\n\n```python\nHFModelConfiguration(**kwargs)\n```\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n\n## Attributes\n\n| Attribute | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `model_name` | `str` | `\"\"` | |\n| `model_path` | `str \\| None` | `None` | |\n| `architecture` | `ModelArchitecture \\| None` | `None` | |\n| `response_parser` | `Optional[Callable[[str], ParsedResponse]]` | `None` | |\n\n## Methods\n\n### `download(self) -> 'None'`\n\nDownload or materialize weights into the model volume.\n\n### `parse_response(self, text: 'str') -> 'ParsedResponse'`\n\nParse raw model output into structured content.\n\n**Source:** [`modal_training_gym/common/models/base.py`](https://github.com/modal-projects/training-gym/blob/main/modal_training_gym/common/models/base.py)\n"
HFModelConfiguration
ModelConfig for models hosted on HuggingFace.
from modal_training_gym.common.models.base import HFModelConfigurationModelConfig for models hosted on HuggingFace.
Implements download() via huggingface_hub.snapshot_download
using self.model_name as the repo ID. An empty model_path is
seeded from the snapshot; a populated one already holds the weights to
load and is left untouched.
Inherits from: ModelConfig
Constructor
Section titled “Constructor”HFModelConfiguration(**kwargs)| Parameter | Type | Default | Description |
|---|
Attributes
Section titled “Attributes”| Attribute | Type | Default | Description |
|---|---|---|---|
model_name | str | "" | |
model_path | str | None | None | |
architecture | ModelArchitecture | None | None | |
response_parser | Optional[Callable[[str], ParsedResponse]] | None |
Methods
Section titled “Methods”download(self) -> 'None'
Section titled “download(self) -> 'None'”Download or materialize weights into the model volume.
parse_response(self, text: 'str') -> 'ParsedResponse'
Section titled “parse_response(self, text: 'str') -> 'ParsedResponse'”Parse raw model output into structured content.