[Spec][Ngram] Clean up unused stateless batchMatch (#22487)
This commit is contained in:
@@ -74,23 +74,6 @@ def get_ngram_corpus_cls():
|
||||
tokens_flat, offsets = _to_csr(batch_tokens)
|
||||
self.async_insert(tokens_flat, offsets) # type: ignore
|
||||
|
||||
def match(
|
||||
self,
|
||||
batch_tokens: List[List[int]],
|
||||
) -> Tuple[np.ndarray, np.ndarray]:
|
||||
tokens_flat, offsets = _to_csr(batch_tokens)
|
||||
batch_size = len(batch_tokens)
|
||||
d = self._draft_token_num
|
||||
|
||||
out_tokens = torch.zeros(batch_size * d, dtype=torch.int32)
|
||||
out_mask = torch.zeros(batch_size * d * d, dtype=torch.uint8)
|
||||
|
||||
self.batch_match(tokens_flat, offsets, out_tokens, out_mask) # type: ignore
|
||||
|
||||
return out_tokens.numpy().astype(np.int64), out_mask.numpy().astype(
|
||||
np.int64
|
||||
)
|
||||
|
||||
def match_stateful(
|
||||
self,
|
||||
state_ids: List[int],
|
||||
|
||||
Reference in New Issue
Block a user