Skip to content
Open
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
5 changes: 5 additions & 0 deletions integration-test/models/dummy-chat/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
)


MAX_BATCH_SIZE = 128


@instill_deployment
class Chat:
def __init__(self):
Expand All @@ -15,6 +18,8 @@ async def __call__(self, request):
inputs = await parse_task_chat_to_chat_input(request=request)

input_len = len(inputs)
if input_len > MAX_BATCH_SIZE:
raise ValueError(f"batch size exceeds maximum allowed: {MAX_BATCH_SIZE}")

finish_reasons = [["length"] for _ in range(input_len)]
indexes = [list(range(input_len))]
Expand Down
Loading