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

remove dead code #226

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
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
33 changes: 0 additions & 33 deletions src/litserve/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,6 @@
from litserve.specs.base import LitSpec


def no_batch_unbatch_message_no_stream(obj, data):
return f"""
You set `max_batch_size > 1`, but the default implementation for batch() and unbatch() only supports
PyTorch tensors or NumPy ndarrays, while we found {type(data)}.
Please implement these two methods in {obj.__class__.__name__}.

Example:

def batch(self, inputs):
return np.stack(inputs)

def unbatch(self, output):
return list(output)
"""


def no_batch_unbatch_message_stream(obj, data):
return f"""
You set `max_batch_size > 1`, but the default implementation for batch() and unbatch() only supports
PyTorch tensors or NumPy ndarrays, while we found {type(data)}.
Please implement these two methods in {obj.__class__.__name__}.

Example:

def batch(self, inputs):
return np.stack(inputs)

def unbatch(self, output):
for out in output:
yield list(out)
"""


class LitAPI(ABC):
_stream: bool = False
_default_unbatch: callable = None
Expand Down
Loading