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

v1.2.0 版本是不是与 pydantic 冲突了 #2765

Open
1 of 3 tasks
JasonHZS opened this issue Jan 16, 2025 · 2 comments
Open
1 of 3 tasks

v1.2.0 版本是不是与 pydantic 冲突了 #2765

JasonHZS opened this issue Jan 16, 2025 · 2 comments
Milestone

Comments

@JasonHZS
Copy link

System Info / 系統信息

使用 nvidia/cuda:12.1.0-devel-ubuntu22.04 镜像

Running Xinference with Docker? / 是否使用 Docker 运行 Xinfernece?

  • docker / docker
  • pip install / 通过 pip install 安装
  • installation from source / 从源码安装

Version info / 版本信息

1.2.0

The command used to start Xinference / 用以启动 xinference 的命令

docker compose up -d

Reproduction / 复现过程

代码:
from xinference import Model

报错:
app-1 | warnings.warn(
app-1 | Traceback (most recent call last):
app-1 | File "/app/app.py", line 11, in
app-1 | from routers.query_router import QueryRouter
app-1 | File "/app/routers/query_router.py", line 3, in
app-1 | from services.model_service import ModelService
app-1 | File "/app/services/model_service.py", line 5, in
app-1 | from xinference.client import Client
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/xinference/init.py", line 32, in
app-1 | _install()
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/xinference/init.py", line 29, in _install
app-1 | install_model()
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/xinference/model/init.py", line 19, in _install
app-1 | llm_install()
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/xinference/model/llm/init.py", line 50, in _install
app-1 | from .ggml.chatglm import ChatglmCppChatModel
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/xinference/model/llm/ggml/chatglm.py", line 22, in
app-1 | from ....types import (
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/xinference/types.py", line 440, in
app-1 | CreateChatCompletionOpenAI = create_model_from_typeddict(
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/annotated_types.py", line 55, in create_model_from_typeddict
app-1 | return create_model(typeddict_cls.name, **kwargs, **field_definitions)
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/main.py", line 1024, in create_model
app-1 | return meta(_model_name, resolved_bases, namespace, **kwds)
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/main.py", line 197, in new
app-1 | fields[ann_name] = ModelField.infer(
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 504, in infer
app-1 | return cls(
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 434, in init
app-1 | self.prepare()
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 550, in prepare
app-1 | self.type_analysis()
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 661, in type_analysis
app-1 | self.sub_fields = [self.create_sub_type(t, f'{self.name}{display_as_type(t)}') for t in types
]
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 661, in
app-1 | self.sub_fields = [self.create_sub_type(t, f'{self.name}{display_as_type(t)}') for t in types
]
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 806, in create_sub_type
app-1 | return self.class(
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 434, in init
app-1 | self.prepare()
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 555, in prepare
app-1 | self.populate_validators()
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 829, in populate_validators
app-1 | *(get_validators() if get_validators else list(find_validators(self.type
, self.model_config))),
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/validators.py", line 739, in find_validators
app-1 | yield make_typeddict_validator(type
, config)
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/validators.py", line 625, in make_typeddict_validator
app-1 | TypedDictModel = create_model_from_typeddict(
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/annotated_types.py", line 55, in create_model_from_typeddict
app-1 | return create_model(typeddict_cls.name, **kwargs, **field_definitions)
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/main.py", line 1024, in create_model
app-1 | return meta(model_name, resolved_bases, namespace, **kwds)
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/main.py", line 197, in new
app-1 | fields[ann_name] = ModelField.infer(
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 504, in infer
app-1 | return cls(
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 434, in init
app-1 | self.prepare()
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 555, in prepare
app-1 | self.populate_validators()
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/fields.py", line 829, in populate_validators
app-1 | *(get_validators() if get_validators else list(find_validators(self.type
, self.model_config))),
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/validators.py", line 739, in find_validators
app-1 | yield make_typeddict_validator(type
, config)
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/validators.py", line 625, in make_typeddict_validator
app-1 | TypedDictModel = create_model_from_typeddict(
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/annotated_types.py", line 55, in create_model_from_typeddict
app-1 | return create_model(typeddict_cls.name, **kwargs, **field_definitions)
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/main.py", line 1024, in create_model
app-1 | return meta(__model_name, resolved_bases, namespace, **kwds)
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/main.py", line 186, in new
app-1 | validate_field_name(bases, ann_name)
app-1 | File "/root/.cache/pypoetry/virtualenvs/reading-copilot-9TtSrW0h-py3.10/lib/python3.10/site-packages/pydantic/v1/utils.py", line 168, in validate_field_name
app-1 | raise NameError(
app-1 | NameError: Field name "schema" shadows a BaseModel attribute; use a different field name with "alias='schema'".

Expected behavior / 期待表现

导入 xinference 不会报错

@XprobeBot XprobeBot added the gpu label Jan 16, 2025
@XprobeBot XprobeBot added this to the v1.x milestone Jan 16, 2025
@qinxuye
Copy link
Contributor

qinxuye commented Jan 17, 2025

from xinference import Model

这个本来就无法运行。

Copy link

This issue is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants