Skip to content
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 fastchat/serve/vllm_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __init__(
logger.info(
f"Loading the model {self.model_names} on worker {worker_id}, worker type: vLLM worker..."
)
self.llm_engine = llm_engine
self.tokenizer = llm_engine.engine.tokenizer
# This is to support vllm >= 0.2.7 where TokenizerGroup was introduced
# and llm_engine.engine.tokenizer was no longer a raw tokenizer
Expand Down Expand Up @@ -116,7 +117,7 @@ async def generate_stream(self, params):
frequency_penalty=frequency_penalty,
best_of=best_of,
)
results_generator = engine.generate(context, sampling_params, request_id)
results_generator = self.llm_engine.generate(context, sampling_params, request_id)

async for request_output in results_generator:
prompt = request_output.prompt
Expand All @@ -135,7 +136,7 @@ async def generate_stream(self, params):

aborted = False
if request and await request.is_disconnected():
await engine.abort(request_id)
await self.llm_engine.abort(request_id)
request_output.finished = True
aborted = True
for output in request_output.outputs:
Expand Down
Loading