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] server启动模型,调用流式返回报错 #2920

Open
3 tasks
pangr opened this issue Dec 18, 2024 · 1 comment
Open
3 tasks

[Bug] server启动模型,调用流式返回报错 #2920

pangr opened this issue Dec 18, 2024 · 1 comment
Assignees

Comments

@pangr
Copy link

pangr commented Dec 18, 2024

Checklist

  • 1. I have searched related issues but cannot get the expected help.
  • 2. The bug has not been fixed in the latest version.
  • 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.

Describe the bug

server启动模型,调用流式返回报错
image

`from lmdeploy.serve.openai.api_client import APIClient
from concurrent.futures import ThreadPoolExecutor

prompt = '''你是一个资深的科普大师,擅长以通俗易懂的方式介绍事物是什么吗'''

api_client = APIClient(f'http://0.0.0.0:23333')
model_name = api_client.available_models[0]

def post():
messages=[
{"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
{"role": "user", "content": prompt},
]
for item in api_client.chat_completions_v1(model=model_name,
messages=messages, temperature=0.0, top_p=1.0, stream=True):
print(item)

#for i in range(100):
with ThreadPoolExecutor(max_workers=1) as executor:
for i in range(10000):
#time.sleep(1 / qps)
future = executor.submit(post,)`

Reproduction

lmdeploy serve api_server modelpath --server-port 23333 --cache-max-entry-count 0.85 --log-level CRITICAL

Environment

lmdeploy 0.5.1
cuda12.1

Error traceback

No response

@AllentDan
Copy link
Collaborator

Upgrade pydantic please.

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

No branches or pull requests

2 participants