Skip to content

Commit

Permalink
Fix 'Actor methods cannot be called directly' when using `--engine-us…
Browse files Browse the repository at this point in the history
…e-ray` (vllm-project#2664)

* fix: engine-useray complain

* fix: typo
  • Loading branch information
HermitSun authored and NikolaBorisov committed Jan 31, 2024
1 parent 022c347 commit 85df812
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions vllm/engine/async_llm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,19 @@ async def add_request(

if arrival_time is None:
arrival_time = time.time()
prompt_token_ids = await self.engine.encode_request_async(
request_id=request_id,
prompt=prompt,
prompt_token_ids=prompt_token_ids,
lora_request=lora_request)

if self.engine_use_ray:
prompt_token_ids = await self.engine.encode_request_async.remote(
request_id=request_id,
prompt=prompt,
prompt_token_ids=prompt_token_ids,
lora_request=lora_request)
else:
prompt_token_ids = await self.engine.encode_request_async(
request_id=request_id,
prompt=prompt,
prompt_token_ids=prompt_token_ids,
lora_request=lora_request)

stream = self._request_tracker.add_request(
request_id,
Expand Down

0 comments on commit 85df812

Please sign in to comment.