jaraco / inflect

Correctly generate plurals, ordinals, indefinite articles; convert numbers to words
https://pypi.org/project/inflect
MIT License
969 stars 106 forks source link

Inflect is not compatible with latest pydantic version 1.10.4 #173

Closed xqiu closed 1 year ago

xqiu commented 1 year ago

When playing with https://github.com/neonbjb/tortoise-tts, it uses inflect, which causes

(base) C:\software\ai\tortoise-tts>python tortoise/do_tts.py --text "I'm going to speak this" --voice random --preset fast
Traceback (most recent call last):
  File "C:\software\ai\tortoise-tts\tortoise\do_tts.py", line 7, in <module>
    from api import TextToSpeech, MODELS_DIR
  File "C:\software\ai\tortoise-tts\tortoise\api.py", line 24, in <module>
    from tortoise.utils.tokenizer import VoiceBpeTokenizer
  File "C:\Users\xqiu\anaconda3\lib\site-packages\tortoise-2.4.2-py3.9.egg\tortoise\utils\tokenizer.py", line 4, in <module>
    import inflect
  File "C:\Users\xqiu\anaconda3\lib\site-packages\inflect-6.0.2-py3.9.egg\inflect\__init__.py", line 76, in <module>
    from pydantic import Field, validate_arguments
  File "pydantic\__init__.py", line 2, in init pydantic.__init__
  File "pydantic\dataclasses.py", line 46, in init pydantic.dataclasses
    # +---------+-----------------------------------------+
  File "pydantic\main.py", line 121, in init pydantic.main
TypeError: dataclass_transform() got an unexpected keyword argument 'field_specifiers'

related: https://github.com/pydantic/pydantic/issues/4885

Workaround: I need to do pip install pydantic==1.9.2 to resolve the issue.

jaraco commented 1 year ago

This issue was fixed upstream.