Skip to content

Commit

Permalink
fix end of request behaviour and add back broadcasting tokens to othe…
Browse files Browse the repository at this point in the history
…r nodes
  • Loading branch information
AlexCheema committed Nov 21, 2024
1 parent c773552 commit 72c3fda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exo/orchestration/standard_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ async def process_inference_result(
token = await self.inference_engine.sample(result)
await self.inference_engine.ensure_shard(shard)
self.buffered_token_output[request_id][0].append(token.item())
self.trigger_on_token_callbacks(request_id, self.buffered_token_output[request_id][0], is_finished)
if DEBUG >= 2: print(f"[{request_id}] result size: {result.size}, is finished: {is_finished}, buffered tokens: {len(self.buffered_token_output[request_id][0])}")
is_finished = token.item() == self.inference_engine.tokenizer.eos_token_id
forward = token.reshape(1, -1)
self.trigger_on_token_callbacks(request_id, self.buffered_token_output[request_id][0], is_finished)
asyncio.create_task(self.broadcast_result(request_id, self.buffered_token_output[request_id][0], is_finished))
else:
forward = result

Expand Down

0 comments on commit 72c3fda

Please # to comment.