Skip to content
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

upgrade Pydantic version to fix TypeError crash #59

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rambling-ai
Copy link

With a fresh install on a fresh Ubuntu 22.04 vm, running the training script crashes with a TypeError:

Traceback (most recent call last):
  File "/home/user/sliders/trainscripts/textsliders/train_lora_xl.py", line 18, in <module>
    import prompt_util
  File "/home/user/sliders/trainscripts/textsliders/prompt_util.py", line 44, in <module>
    class PromptSettings(BaseModel):  # yaml のやつ
  File "pydantic/main.py", line 198, in pydantic.main.ModelMetaclass.__new__
  File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer
  File "pydantic/fields.py", line 436, in pydantic.fields.ModelField.__init__
  File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare
  File "pydantic/fields.py", line 668, in pydantic.fields.ModelField._type_analysis
  File "/home/user/miniconda3/envs/sliders/lib/python3.9/typing.py", line 852, in __subclasscheck__
    return issubclass(cls, self.__origin__)
TypeError: issubclass() arg 1 must be a class

The cause is in requirements.txt: the pinned Pydantic version is a revoked release that had a bug. Using any newer Pydantic release fixes the crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant