Skip to content

Commit fdcb3c9

Browse files
Merge pull request #2813 from AI-Hypercomputer:aireen/fix_pyconfig
PiperOrigin-RevId: 843338595
2 parents 5d5eeb5 + 938a336 commit fdcb3c9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/MaxText/pyconfig.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,11 @@ def tree_flatten(self):
165165

166166
def __getattr__(self, attr: str) -> Any:
167167
"""Provides attribute-style access to the final configuration dictionary."""
168-
if attr in self._flat_config:
169-
return self._flat_config[attr]
168+
# Use object.__getattribute__ to avoid recursion when accessing _flat_config
169+
# This is necessary for proper pickling/unpickling support
170+
flat_config = object.__getattribute__(self, "_flat_config")
171+
if attr in flat_config:
172+
return flat_config[attr]
170173
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{attr}'")
171174

172175
def __setattr__(self, attr: str, value: Any) -> None:

0 commit comments

Comments
 (0)