Tokenization improvements
This commit is contained in:
parent
cd08eb0753
commit
ad8ac545a5
5 changed files with 19 additions and 15 deletions
|
@ -107,8 +107,8 @@ class Exllamav2Model:
|
|||
return self.tokenizer.encode(string, add_bos=True)
|
||||
|
||||
def decode(self, ids, **kwargs):
|
||||
if isinstance(ids, int):
|
||||
ids = torch.tensor([[ids]])
|
||||
if isinstance(ids, list):
|
||||
ids = torch.tensor([ids])
|
||||
elif isinstance(ids, torch.Tensor) and ids.numel() == 1:
|
||||
ids = ids.view(1, -1)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue