cirediatpl / FigmaChain

FigmaChain is a set of Python scripts that generate HTML/CSS code based on Figma designs. Using OpenAI's GPT-3 model, FigmaChain enables developers to quickly generate HTML/CSS code from a Figma design input. It also includes a Streamlit-based chatbot interface for interactive code generation.
943 stars 86 forks source link

PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`. #6

Open lolliuym opened 1 year ago

lolliuym commented 1 year ago

The error message you're seeing indicates that there is an issue with the usage of the @root_validator decorator from the Pydantic library. Starting from version 2.0.2, if you use @root_validator with pre=False (which is the default behavior), you must specify skip_on_failure=True to avoid this error.

File containing root_validator not found !

image

lolliuym commented 1 year ago

the tips below didn't help:

To resolve this issue, you have a few options:

  1. Update Pydantic: Make sure you have the latest version of Pydantic installed. You can use pip install --upgrade pydantic to upgrade to the latest version.

  2. Replace @root_validator with @model_validator: As mentioned in the error message, @root_validator is deprecated and should be replaced with @model_validator. Update your code to use @model_validator instead.

  3. Specify skip_on_failure=True: If you want to continue using @root_validator, you can add the skip_on_failure=True parameter to the decorator. This will prevent the error from occurring. For example:

@root_validator(pre=False, skip_on_failure=True) def my_validator(cls, values):

Your validation logic here

return values

Someone please help me in fixing this.

Thanks in advance :).

JhdChk commented 11 months ago

I keep getting the same error. Does anyone have a solution please?

Shaon2221 commented 9 months ago

Use pydantic following version Pydantic==1.10.7

jeanru commented 8 months ago

I fixed this issue by using below command to install pydantic.

pip install pydantic==1.10.7