mirror of
https://github.com/turboderp-org/exllamav2.git
synced 2026-04-20 14:29:28 +00:00
Merge PR #296
This commit is contained in:
@@ -316,10 +316,19 @@ class ExLlamaV2Tokenizer:
|
||||
return text
|
||||
|
||||
|
||||
# Decode IDs
|
||||
# Decode IDs, or a list of IDs
|
||||
|
||||
def decode(self, ids, decode_special_tokens = False):
|
||||
|
||||
if isinstance(ids, list):
|
||||
|
||||
texts = []
|
||||
for i in ids:
|
||||
texts.append(self.decode(i, decode_special_tokens))
|
||||
return texts
|
||||
|
||||
assert isinstance(ids, torch.Tensor), "ids must be Tensor"
|
||||
|
||||
if ids.dim() > 1:
|
||||
|
||||
texts = []
|
||||
@@ -334,7 +343,7 @@ class ExLlamaV2Tokenizer:
|
||||
text = self.decode_(ids, decode_special_tokens)
|
||||
return text
|
||||
|
||||
|
||||
|
||||
# Create padding mask
|
||||
|
||||
def padding_mask(self, ids):
|
||||
|
||||
Reference in New Issue
Block a user