Skip to content

Commit aec08f1

Browse files
saum7800Saumya Gandhi
and
Saumya Gandhi
authored
fix internal config issue (#116)
Co-authored-by: Saumya Gandhi <[email protected]>
1 parent bcb92e7 commit aec08f1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/art/model.py

+8
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ class TrainableModel(Model):
168168
# Use at your own risk.
169169
_internal_config: dev.InternalModelConfig | None = None
170170

171+
def __init__(self, **data):
172+
# Pop any internal config provided at construction and assign it
173+
internal_cfg = data.pop("_internal_config", None)
174+
super().__init__(**data)
175+
if internal_cfg is not None:
176+
# Bypass BaseModel __setattr__ to allow setting private attr
177+
object.__setattr__(self, "_internal_config", internal_cfg)
178+
171179
async def register(
172180
self,
173181
backend: "Backend",

0 commit comments

Comments
 (0)