[Performance] Batch Send from Tokenizer Manager. (#9436)
This commit is contained in:
committed by
GitHub
parent
3aec3d4f8b
commit
ea0696b924
@@ -533,6 +533,21 @@ class TokenizedGenerateReqInput:
|
||||
dp_balance_id: int = -1
|
||||
|
||||
|
||||
@dataclass
|
||||
class BatchTokenizedGenerateReqInput:
|
||||
# The batch of tokenized requests
|
||||
batch: List[TokenizedGenerateReqInput]
|
||||
|
||||
def __len__(self):
|
||||
return len(self.batch)
|
||||
|
||||
def __getitem__(self, i):
|
||||
return self.batch[i]
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.batch)
|
||||
|
||||
|
||||
@dataclass
|
||||
class EmbeddingReqInput:
|
||||
# The input prompt. It can be a single prompt or a batch of prompts.
|
||||
@@ -668,6 +683,21 @@ class TokenizedEmbeddingReqInput:
|
||||
dp_balance_id: int = -1
|
||||
|
||||
|
||||
@dataclass
|
||||
class BatchTokenizedEmbeddingReqInput:
|
||||
# The batch of tokenized embedding requests
|
||||
batch: List[TokenizedEmbeddingReqInput]
|
||||
|
||||
def __len__(self):
|
||||
return len(self.batch)
|
||||
|
||||
def __getitem__(self, i):
|
||||
return self.batch[i]
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.batch)
|
||||
|
||||
|
||||
@dataclass
|
||||
class BatchTokenIDOut:
|
||||
# The request id
|
||||
|
||||
Reference in New Issue
Block a user