400 on empty input_ids (#4481)

This commit is contained in:
Yinghai Lu
2025-03-16 14:01:23 -07:00
committed by GitHub
parent 25e1816eff
commit 799fb5f455

View File

@@ -103,6 +103,8 @@ class GenerateReqInput:
self.batch_size = len(self.text)
self.input_embeds = None
elif self.input_ids is not None:
if len(self.input_ids) == 0:
raise ValueError("input_ids cannot be empty.")
if isinstance(self.input_ids[0], int):
self.is_single = True
self.batch_size = 1