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` (#2664)

* fix: engine-useray complain

* fix: typo
  • Loading branch information
HermitSun authored Jan 30, 2024
1 parent ab40644 commit d79ced3
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 @@ -447,11 +447,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 d79ced3

Please sign in to comment.