MCPcopy Create free account
hub / github.com/AI-Hypercomputer/maxtext / initialize

Function initialize

src/MaxText/pyconfig.py:200–210  ·  view source on GitHub ↗

Initializes the configuration by loading YAML files, and applying CLI, env, and kwarg overrides.

(argv: list[str], **kwargs)

Source from the content-addressed store, hash-verified

198
199
200def initialize(argv: list[str], **kwargs) -> HyperParameters:
201 """Initializes the configuration by loading YAML files, and applying CLI, env, and kwarg overrides."""
202 pydantic_config = initialize_pydantic(argv, **kwargs)
203 config = HyperParameters(pydantic_config)
204
205 if config.log_config:
206 for k, v in sorted(config.get_keys().items()):
207 if k != "hf_access_token":
208 logger.info("Config param %s: %s", k, v)
209
210 return config
211
212
213def initialize_pydantic(argv: list[str], **kwargs) -> MaxTextConfig:

Callers

nothing calls this directly

Calls 3

get_keysMethod · 0.95
initialize_pydanticFunction · 0.85
HyperParametersClass · 0.70

Tested by

no test coverage detected