Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Serve] Fix the serve.batch api doc #33588

Merged
merged 2 commits into from
Mar 27, 2023
Merged
Changes from 1 commit
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
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.lowerer() for s in batch] # doctest: +SKIP
sihanwang41 marked this conversation as resolved.
Show resolved Hide resolved
>>> 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