[OAI] patch origin request_id logic (#7508)
This commit is contained in:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user