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

[serve][doc] update serve vllm openai example for latest vllm version #50047

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions doc/source/serve/doc_code/vllm_openai_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ErrorResponse,
)
from vllm.entrypoints.openai.serving_chat import OpenAIServingChat
from vllm.entrypoints.openai.serving_engine import LoRAModulePath, PromptAdapterPath
from vllm.entrypoints.openai.serving_engine import LoRAModulePath, PromptAdapterPath, BaseModelPath
from vllm.utils import FlexibleArgumentParser
from vllm.entrypoints.logger import RequestLogger

Expand Down Expand Up @@ -70,7 +70,7 @@ async def create_chat_completion(
if self.engine_args.served_model_name is not None:
served_model_names = self.engine_args.served_model_name
else:
served_model_names = [self.engine_args.model]
served_model_names = [BaseModelPath(name=self.engine_args.model, model_path="./")]
self.openai_serving_chat = OpenAIServingChat(
self.engine,
model_config,
Expand All @@ -80,6 +80,7 @@ async def create_chat_completion(
prompt_adapters=self.prompt_adapters,
request_logger=self.request_logger,
chat_template=self.chat_template,
chat_template_content_format="auto"
)
logger.info(f"Request: {request}")
generator = await self.openai_serving_chat.create_chat_completion(
Expand Down