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

[BUG] vllm0.3.3加速Qwen1.5系列模型,报ImportError: cannot import name 'model_schema' from 'pydantic.schema' #3985

Open
xqxls opened this issue May 10, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@xqxls
Copy link

xqxls commented May 10, 2024

2024-05-10 15:14:44 | INFO | stdout | 本地vllm加速模型
/home/xqxls/git/Langchain-Chatchat/venv/lib/python3.11/site-packages/pydantic/_internal/_config.py:334: UserWarning: Valid config keys have changed in V2:

  • 'schema_extra' has been renamed to 'json_schema_extra'
    warnings.warn(message, UserWarning)
    /home/xqxls/git/Langchain-Chatchat/venv/lib/python3.11/site-packages/pydantic/_internal/fields.py:160: UserWarning: Field "model_name" has conflict with protected namespace "model".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = ().
warnings.warn(
Process API Server:
Traceback (most recent call last):
File "/home/xqxls/anaconda3/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/home/xqxls/anaconda3/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/xqxls/git/Langchain-Chatchat/startup.py", line 456, in run_api_server
app = create_app(run_mode=run_mode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/xqxls/git/Langchain-Chatchat/server/api.py", line 51, in create_app
mount_app_routes(app, run_mode=run_mode)
File "/home/xqxls/git/Langchain-Chatchat/server/api.py", line 77, in mount_app_routes
mount_knowledge_routes(app)
File "/home/xqxls/git/Langchain-Chatchat/server/api.py", line 142, in mount_knowledge_routes
from server.chat.agent_chat import agent_chat
File "/home/xqxls/git/Langchain-Chatchat/server/chat/agent_chat.py", line 15, in
from server.agent.custom_agent.ChatGLM3Agent import initialize_glm3_agent
File "/home/xqxls/git/Langchain-Chatchat/server/agent/custom_agent/ChatGLM3Agent.py", line 9, in
from pydantic.schema import model_schema
ImportError: cannot import name 'model_schema' from 'pydantic.schema' (/home/xqxls/git/Langchain-Chatchat/venv/lib/python3.11/site-packages/pydantic/schema.py)

@xqxls xqxls added the bug Something isn't working label May 10, 2024
Copy link

dosubot bot commented May 10, 2024

The ImportError you're encountering is due to the model_schema function not being available in your current version of Pydantic. This function might have been removed or relocated in newer versions. To resolve this, you might need to either revert to an older version of Pydantic where model_schema was available or adapt your code to work without it, depending on your project's requirements.

For the UserWarnings related to Pydantic configuration and field name conflicts:

  • Update your Pydantic model configurations to use json_schema_extra instead of the deprecated schema_extra.
  • Rename the field model_name in your Pydantic models to avoid conflicts with Pydantic's reserved attributes or methods.

Ensure your Pydantic and FastAPI libraries are up to date and compatible with Python 3.11. Review and adjust your code according to the latest versions of these libraries, paying close attention to deprecated features and breaking changes. After making these changes, thoroughly test your application to confirm everything works as expected.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@zRzRzRzRzRzRzR zRzRzRzRzRzRzR self-assigned this May 10, 2024
@KrisWongz
Copy link

@xqxls 请问这个问题解决了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants