You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It iterates over validation items, thinks that dim is a dict and tries to set the key on the pydantic model in final[key].
I think there needs to be some way for Config to tell apart configs that come with a pydantic Schema and those that come from functions that happen to contain pydantic models. (Luckily I also have attrs in this project so could avoid erroneously casting it to a dict after figuring out the problem)
The text was updated successfully, but these errors were encountered:
Consider this:
So the problem with this is that thinc.Config will generate an
ArgumentModel
from the registered architecture functionhttps://github.com/explosion/thinc/blob/adeb99ab7f005228c5a45a8c755929a6bb081d78/thinc/config.py#L910
in
config._fill
in the first line both validation and results both have the dim attribute at the desired pydantic class.
however on the call to
results.dict()
the pydantic model is transformed to a dictionary as is the behavior of Pydantic .dict method. Then in_update_from_parsed()
https://github.com/explosion/thinc/blob/adeb99ab7f005228c5a45a8c755929a6bb081d78/thinc/config.py#L932
It iterates over
validation
items, thinks thatdim
is a dict and tries to set the key on the pydantic model infinal[key]
.I think there needs to be some way for Config to tell apart configs that come with a pydantic Schema and those that come from functions that happen to contain pydantic models. (Luckily I also have
attrs
in this project so could avoid erroneously casting it to a dict after figuring out the problem)The text was updated successfully, but these errors were encountered: