-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instantiation fails with TypeError only when fail_untyped=False #362
Labels
bug
Something isn't working
Comments
Thank you for reporting! From what I see, the conditional defaults from the AST resolver is not working correctly for the case of For more details about the expected behavior, search for |
6 tasks
I implemented a fix in #364. @cristianregep please test it out. |
Thanks for the quick turnaround. It works |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug report
I'm trying to instantiate a config class from Huggingface with CLI and it fails when
fail_untyped=False
. The fail_untyped is important because I'm doing this as part of a project that is written within the lightning framework, where we make heavy use of lightning cli, which sets fail_untyped to False and you can't change it. Most of our project is written internally by us and is not HuggingFace based, but we want to make use from time to time of some external models in the open source community (like for example HuggingFace).I created an isolated example just with jsonargparse (see below). It only fails when
fail_untyped=False
. I stepped through the instantiation and I'm quite confused of what's happening.num_labels
is not set, and through kwargs.pop("num_labels", 2) it should become 2, which is an int.As a side note I am planning to submit a PR soon to allow people to set fail_untyped in lightning Lightning-AI/pytorch-lightning#18285 .
To reproduce
Config
Command
Expected behavior
No TypeError
Environment
pip install jsonargparse[signatures,typing-extensions]==4.23.1
The text was updated successfully, but these errors were encountered: