Skip to content

Commit

Permalink
[Serve] Fix the serve.batch api doc (ray-project#33588)
Browse files Browse the repository at this point in the history
Fix the example formatting in the serve batch API doc

Signed-off-by: elliottower <elliot@elliottower.com>
  • Loading branch information
sihanwang41 authored and elliottower committed Apr 22, 2023
1 parent 3ae6a77 commit 47b2200
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions python/ray/serve/batching.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,13 @@ def batch(_func=None, max_batch_size=10, batch_wait_timeout_s=0.0):
or `batch_wait_timeout_s` has elapsed, whichever occurs first.
Example:
>>> from ray import serve
>>> @serve.batch(max_batch_size=50, batch_wait_timeout_s=0.5) # doctest: +SKIP
... async def handle_batch(batch: List[str]): # doctest: +SKIP
... return [s.lower() for s in batch] # doctest: +SKIP
>>> async def handle_single(s: str): # doctest: +SKIP
... # Returns s.lower().
... return await handle_batch(s) # doctest: +SKIP
>>> from ray import serve
>>> @serve.batch(max_batch_size=50, batch_wait_timeout_s=0.5) # doctest: +SKIP
... async def handle_batch(batch: List[str]): # doctest: +SKIP
... return [s.lower() for s in batch] # doctest: +SKIP
>>> async def handle_single(s: str): # doctest: +SKIP
... # Returns s.lower().
... return await handle_batch(s) # doctest: +SKIP
Arguments:
max_batch_size: the maximum batch size that will be executed in
Expand Down

0 comments on commit 47b2200

Please sign in to comment.