ssbuild / aigc_serving

aigc_serving lightweight and efficient Language service model reasoning
Apache License 2.0
23 stars 2 forks source link

在Docker中运行改项目,报错提示pydantic 的版本有问题 #23

Closed xiaochaich closed 1 year ago

xiaochaich commented 1 year ago

报错信息如下: 2023-08-24 16:56:58 Traceback (most recent call last): 2023-08-24 16:56:58 File "./serving/main.py", line 16, in 2023-08-24 16:56:58 from serving.serve.api_serving import global_instance, app 2023-08-24 16:56:58 File "/as/serving/serve/api_serving.py", line 20, in 2023-08-24 16:56:58 from serving.serve.api_keys import auth_api_key 2023-08-24 16:56:58 File "/as/serving/serve/api_keys.py", line 7, in 2023-08-24 16:56:58 from pydantic import BaseSettings 2023-08-24 16:56:58 File "/usr/local/lib/python3.8/dist-packages/pydantic/init.py", line 210, in getattr 2023-08-24 16:56:58 return _getattr_migration(attr_name) 2023-08-24 16:56:58 File "/usr/local/lib/python3.8/dist-packages/pydantic/_migration.py", line 289, in wrapper 2023-08-24 16:56:58 raise PydanticImportError( 2023-08-24 16:56:58 pydantic.errors.PydanticImportError: BaseSettings has been moved to the pydantic-settings package. See https://docs.pydantic.dev/2.1.1/migration/#basesettings-has-moved-to-pydantic-settings for more details. 2023-08-24 16:56:58 2023-08-24 16:56:58 For further information visit https://errors.pydantic.dev/2.1.1/u/import-error

我是按照文档中的requirements.txt安装的依赖包,想问一下大佬使用Docker运行的时候pydantic 的版本是使用的那个?

ssbuild commented 1 year ago

pydantic == 1.10.7

xiaochaich commented 1 year ago

指定了pydantic == 1.10.7版本,运行还是报错: 2023-08-24 17:43:00 Traceback (most recent call last): 2023-08-24 17:43:00 File "./serving/main.py", line 16, in 2023-08-24 17:43:00 from serving.serve.api_serving import global_instance, app 2023-08-24 17:43:00 File "/as/serving/serve/api_serving.py", line 14, in 2023-08-24 17:43:00 from serving.openai_api.openai_api_protocol import ModelCard, ModelPermission, ModelList, ChatCompletionRequest, Role, \ 2023-08-24 17:43:00 File "/as/serving/openai_api/openai_api_protocol.py", line 146, in 2023-08-24 17:43:00 class ChatCompletionResponseChoice(BaseModel): 2023-08-24 17:43:00 File "pydantic/main.py", line 197, in pydantic.main.ModelMetaclass.new 2023-08-24 17:43:00 File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer 2023-08-24 17:43:00 File "pydantic/fields.py", line 436, in pydantic.fields.ModelField.init 2023-08-24 17:43:00 File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare 2023-08-24 17:43:00 File "pydantic/fields.py", line 661, in pydantic.fields.ModelField._type_analysis 2023-08-24 17:43:00 File "pydantic/fields.py", line 668, in pydantic.fields.ModelField._type_analysis 2023-08-24 17:43:00 File "/usr/lib/python3.8/typing.py", line 774, in subclasscheck 2023-08-24 17:43:00 return issubclass(cls, self.origin) 2023-08-24 17:43:00 TypeError: issubclass() arg 1 must be a class

😭😭😭😭

ssbuild commented 1 year ago

pip list

xiaochaich commented 1 year ago

Package Version


absl-py 1.4.0 accelerate 0.22.0 aigc-zoo 0.1.21.post1 aiohttp 3.8.5 aiosignal 1.3.1 altair 5.0.1 annotated-types 0.5.0 ansicon 1.89.0 anyio 3.7.1 arrow 1.2.3 async-timeout 4.0.3 attrs 23.1.0 backoff 2.2.1 beautifulsoup4 4.12.2 bitsandbytes 0.41.1 blessed 1.20.0 blinker 1.6.2 cachetools 5.3.1 certifi 2022.12.7 charset-normalizer 2.1.1 click 8.1.7 colorama 0.4.6 cpm-kernels 1.0.11 croniter 1.4.1 data-serialize 0.2.2 dateutils 0.6.12 deep-training 0.1.21.post2 deepdiff 6.3.1 einops 0.6.1 exceptiongroup 1.1.3 fastapi 0.101.1 fastdatasets 0.9.15 filelock 3.9.0 frozenlist 1.4.0 fsspec 2023.6.0 gitdb 4.0.10 GitPython 3.1.32 google-auth 2.22.0 google-auth-oauthlib 1.0.0 grpcio 1.57.0 h11 0.14.0 huggingface-hub 0.16.4 idna 3.4 importlib-metadata 6.8.0 inquirer 3.1.3 ipc-worker 0.1.3 itsdangerous 2.1.2 Jinja2 3.1.2 jinxed 1.2.0 joblib 1.3.2 jsonschema 4.19.0 jsonschema-specifications 2023.7.1 lightning 2.0.7 lightning-cloud 0.5.37 lightning-utilities 0.9.0 Markdown 3.4.4 markdown-it-py 3.0.0 MarkupSafe 2.1.2 mdurl 0.1.2 mpmath 1.2.1 multidict 6.0.4 networkx 3.0 numpy 1.24.1 numpy-io 0.0.8 oauthlib 3.2.2 openai 0.27.9 ordered-set 4.1.0 packaging 23.1 pandas 2.0.3 Pillow 9.3.0 pip 23.2.1 protobuf 4.24.1 psutil 5.9.5 pyarrow 12.0.1 pyasn1 0.5.0 pyasn1-modules 0.3.0 pydantic 1.10.7 pydantic_core 2.4.0 pydeck 0.8.0 Pygments 2.16.1 PyJWT 2.8.0 Pympler 1.0.1 python-dateutil 2.8.2 python-editor 1.0.4 python-multipart 0.0.6 pytorch-lightning 2.0.7 pytz 2023.3 pytz-deprecation-shim 0.1.0.post0 PyYAML 6.0.1 pyzmq 25.1.0 readchar 4.0.5 referencing 0.30.2 regex 2023.8.8 requests 2.28.1 requests-oauthlib 1.3.1 rich 13.5.2 rpds-py 0.9.2 rsa 4.9 safetensors 0.3.2 scikit-learn 1.3.0 scipy 1.11.2 sentencepiece 0.1.99 seqmetric 0.1.2 setuptools 68.0.0 six 1.16.0 smmap 5.0.0 sniffio 1.3.0 soupsieve 2.4.1 starlette 0.27.0 starsessions 1.3.0 streamlit 1.25.0 sympy 1.11.1 tenacity 8.2.3 tensorboard 2.14.0 tensorboard-data-server 0.7.1 termcolor 2.3.0 tfrecords 0.2.15 threadpoolctl 3.2.0 tiktoken 0.4.0 tokenizers 0.13.3 toml 0.10.2 toolz 0.12.0 torch 2.0.1+cu117 torchaudio 2.0.2+cu117 torchmetrics 1.1.0 torchvision 0.15.2+cu117 tornado 6.3.3 tqdm 4.66.1 traitlets 5.9.0 transformers 4.32.0 transformers-stream-generator 0.0.4 typing_extensions 4.7.1 tzdata 2023.3 tzlocal 4.3.1 urllib3 1.26.13 uvicorn 0.23.2 validators 0.21.2 watchdog 3.0.0 wcwidth 0.2.6 websocket-client 1.6.2 websockets 11.0.3 Werkzeug 2.3.7 wheel 0.38.4 yarl 1.9.2 zipp 3.16.2

ssbuild commented 1 year ago

python换成python3.10试试

xiaochaich commented 1 year ago

python换成python3.10还是报同样的错误,大佬有空了可以弄一个docker的包吗,谢谢啦

ssbuild commented 1 year ago

python换成python3.10还是报同样的错误,大佬有空了可以弄一个docker的包吗,谢谢啦

包太大了 , python3.10的错误信息上传下看看。

xiaochaich commented 1 year ago

2023-08-25 15:54:12 Traceback (most recent call last): 2023-08-25 15:54:12 File "./serving/main.py", line 16, in 2023-08-25 15:54:12 from serving.serve.api_serving import global_instance, app 2023-08-25 15:54:12 File "/as/serving/serve/api_serving.py", line 14, in 2023-08-25 15:54:12 from serving.openai_api.openai_api_protocol import ModelCard, ModelPermission, ModelList, ChatCompletionRequest, Role, \ 2023-08-25 15:54:12 File "/as/serving/openai_api/openai_api_protocol.py", line 146, in 2023-08-25 15:54:12 class ChatCompletionResponseChoice(BaseModel): 2023-08-25 15:54:12 File "pydantic/main.py", line 197, in pydantic.main.ModelMetaclass.new 2023-08-25 15:54:12 File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer 2023-08-25 15:54:12 File "pydantic/fields.py", line 436, in pydantic.fields.ModelField.init 2023-08-25 15:54:12 File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare 2023-08-25 15:54:12 File "pydantic/fields.py", line 661, in pydantic.fields.ModelField._type_analysis 2023-08-25 15:54:12 File "pydantic/fields.py", line 668, in pydantic.fields.ModelField._type_analysis 2023-08-25 15:54:12 File "/usr/lib/python3.8/typing.py", line 774, in subclasscheck 2023-08-25 15:54:12 return issubclass(cls, self.origin) 2023-08-25 15:54:12 TypeError: issubclass() arg 1 must be a class

这个就是使用python3.10的错误信息

xiaochaich commented 1 year ago

image

ssbuild commented 1 year ago

看到你的列表里的版本 pydantic 1.10.7 pydantic_core 2.4.0 , 卸载后 重装下 应该就可以了。pydantic_core冲突。

xiaochaich commented 1 year ago

重装了,还是同样的报错。 image

ssbuild commented 1 year ago

加群反馈一下信息吧