diff --git a/src/art/model.py b/src/art/model.py index 21244ad8..0c706add 100644 --- a/src/art/model.py +++ b/src/art/model.py @@ -706,6 +706,9 @@ def __init__( report_metrics=report_metrics, **kwargs, ) + if _internal_config is not None: + # Bypass BaseModel __setattr__ to allow setting private attr + object.__setattr__(self, "_internal_config", _internal_config) object.__setattr__(self, "_costs_lock", asyncio.Lock()) object.__setattr__(self, "_cost_calculator", self._noop_cost_calculator) @@ -725,9 +728,6 @@ def _noop_cost_calculator( _prompt_tokens: int | None, _completion_tokens: int | None ) -> dict[str, float]: return {} - if _internal_config is not None: - # Bypass BaseModel __setattr__ to allow setting private attr - object.__setattr__(self, "_internal_config", _internal_config) @overload def __new__(