Skip to content
GitHub
View on GitHub

HFModelConfiguration

ModelConfig for models hosted on HuggingFace.

from modal_training_gym.common.models.base import HFModelConfiguration

ModelConfig 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

HFModelConfiguration(**kwargs)
ParameterTypeDefaultDescription
AttributeTypeDefaultDescription
model_namestr""
model_pathstr | NoneNone
architectureModelArchitecture | NoneNone
response_parserOptional[Callable[[str], ParsedResponse]]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.

Source: modal_training_gym/common/models/base.py