File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 9
9
from fastapi import Request
10
10
11
11
from vllm .config import ModelConfig
12
+ from vllm .engine .async_llm_engine import AsyncLLMEngine
13
+ from vllm .engine .multiprocessing .client import MQLLMEngineClient
12
14
from vllm .engine .protocol import EngineClient
13
15
from vllm .entrypoints .chat_utils import (ConversationMessage ,
14
16
apply_hf_chat_template ,
@@ -235,6 +237,11 @@ async def create_chat_completion(
235
237
log_tracing_disabled_warning ()
236
238
237
239
if isinstance (sampling_params , BeamSearchParams ):
240
+ assert isinstance (self .engine_client ,
241
+ (AsyncLLMEngine ,
242
+ MQLLMEngineClient )), \
243
+ "Beam search is only supported with" \
244
+ "AsyncLLMEngine and MQLLMEngineClient."
238
245
result_generator = self .engine_client .beam_search (
239
246
engine_inputs ['prompt_token_ids' ],
240
247
request_id ,
Original file line number Diff line number Diff line change 8
8
from fastapi import Request
9
9
10
10
from vllm .config import ModelConfig
11
+ from vllm .engine .async_llm_engine import AsyncLLMEngine
12
+ from vllm .engine .multiprocessing .client import MQLLMEngineClient
11
13
from vllm .engine .protocol import EngineClient
12
14
from vllm .entrypoints .logger import RequestLogger
13
15
# yapf conflicts with isort for this block
@@ -149,6 +151,11 @@ async def create_completion(
149
151
log_tracing_disabled_warning ()
150
152
151
153
if isinstance (sampling_params , BeamSearchParams ):
154
+ assert isinstance (self .engine_client ,
155
+ (AsyncLLMEngine ,
156
+ MQLLMEngineClient )), \
157
+ "Beam search is only supported with" \
158
+ "AsyncLLMEngine and MQLLMEngineClient."
152
159
generator = self .engine_client .beam_search (
153
160
prompt_inputs ["prompt_token_ids" ],
154
161
request_id ,
You can’t perform that action at this time.
0 commit comments