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
from langchain_community.embeddings import HuggingFaceBgeEmbeddings - results warning - pydantic/_internal/_fields.py:132: UserWarning: Field "model_name" in HuggingFaceInferenceAPIEmbeddings has conflict with protected namespace "model_".
#26861
I searched the LangChain documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
I am sure that this is a bug in LangChain rather than my code.
The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
Example Code
'''from langchain_community.embeddings import HuggingFaceBgeEmbeddings'''
generates:
pydantic/_internal/fields.py:132: UserWarning: Field "model_name" in HuggingFaceInferenceAPIEmbeddings has conflict with protected namespace "model".
You may be able to resolve this warning by setting model_config['protected_namespaces'] = ().
warnings.warn(
warning:
pydantic/_internal/fields.py:132: UserWarning: Field "model_name" in HuggingFaceInferenceAPIEmbeddings has conflict with protected namespace "model".
You may be able to resolve this warning by setting model_config['protected_namespaces'] = ().
warnings.warn(
Description
as noted importing HuggingFaceBgeEmbeddings generates a warning
System Info
python -m langchain_core.sys_info
System Information
OS: Linux
OS Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024
Python Version: 3.12.6 | packaged by conda-forge | (main, Sep 22 2024, 14:16:49) [GCC 13.3.0]
Is that something that should also be ported to other Embeddings and Chats?
I am getting the same warnings when working with Bedrock and langchain-community 0.3.1
Checked other resources
Example Code
'''from langchain_community.embeddings import HuggingFaceBgeEmbeddings'''
generates:
pydantic/_internal/fields.py:132: UserWarning: Field "model_name" in HuggingFaceInferenceAPIEmbeddings has conflict with protected namespace "model".
You may be able to resolve this warning by setting
model_config['protected_namespaces'] = ()
.warnings.warn(
looking at pydantic/pydantic#7121 and
langchain/libs/community/langchain_community/cross_encoders/huggingface.py
Line 48 in a001006
similar is missing in HuggingFaceBgeEmbeddings
Error Message and Stack Trace (if applicable)
warning:
pydantic/_internal/fields.py:132: UserWarning: Field "model_name" in HuggingFaceInferenceAPIEmbeddings has conflict with protected namespace "model".
You may be able to resolve this warning by setting
model_config['protected_namespaces'] = ()
.warnings.warn(
Description
System Info
python -m langchain_core.sys_info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: