[OAI] patch origin request_id logic (#7508)

This commit is contained in:
ybyang
2025-06-25 11:09:38 +08:00
committed by GitHub
parent 57ab776910
commit 03c039c48e
5 changed files with 19 additions and 5 deletions

View File

@@ -319,8 +319,16 @@ class GenerateReqInput:
"""Normalize request IDs for batch processing."""
if self.rid is None:
self.rid = [uuid.uuid4().hex for _ in range(num)]
elif not isinstance(self.rid, list):
raise ValueError("The rid should be a list for batch processing.")
elif isinstance(self.rid, str):
new_rids = [f"{self.rid}_{i}" for i in range(num)]
self.rid = new_rids
elif isinstance(self.rid, list):
if len(self.rid) != num:
raise ValueError(
"The specified rids length mismatch with the batch_size for batch processing."
)
else:
raise ValueError("The rid should be a string or a list of strings.")
def _normalize_logprob_params(self, num):
"""Normalize logprob-related parameters for batch processing."""