I'm having following error while trying to load the hugging face pipeline from langchain
PydanticUserError: If you use
@root_validator
with pre=False (the default) you MUST specifyskip_on_failure=True
. Note that@root_validator
is deprecated and should be replaced with@model_validator
.
I tried to following solution but the problem doesn't go away
from pydantic import BaseModel, validator
class HuggingFacePipeline(BaseModel):
# Existing code...
@validator("*", pre=True)
def check_skip_on_failure(cls, value):
return value
# Existing code...