-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
protected_namespaces warning fixed for model_name & model_info #3334
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing PR - @CyanideByte can you add some testing to ensure this warning never appears again ?
Thanks, I added a pytest to check if the warning happens when importing litellm. |
Have a look at #3340 that covers couple more files with possible similar warnings |
Nice find, I merged the _types.py cases from your PR. It looks like we both had the ones from the other 2 files. |
I encountered this error E:\python3.11\Lib\site-packages\pydantic_internal_fields.py:160: UserWarning: Field "model_name" has conflict with protected namespace "model_". You may be able to resolve this warning by setting You may be able to resolve this warning by setting |
@zheyi911 This PR is not yet merged into the main branch. Could to check if you get the same results from https://github.com/CyanideByte/litellm/tree/main ? I think this PR is ready to merge |
Thanks @edwinjosegeorge @CyanideByte LGTM! |
Seems like this should fix the issue I've been seeing. Is this fix also reflected in the latest docker image for the proxy server? Currently using ghcr.io/berriai/litellm:main-latest and I still see this warning message resulting in container continuously restarting. |
This is a followup to #2893
In litellm 1.35.25 a few more instances of this warning appeared.
UserWarning: Field "model_name" has conflict with protected namespace "model_".
UserWarning: Field "model_config" has conflict with protected namespace "model_".
You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`. warnings.warn(
I've resolved this warning by adding the changes to the new classes in the same manner as the previous PR.
Also added a pytest to detect this issue in the future.
EDIT: Merged _types.py from @edwinjosegeorge PR#3340 - Nice finds!