mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-12-06 07:12:10 +01:00
Fix the exllamav2 loader ignoring add_bos
This commit is contained in:
parent
d86b0ec010
commit
c6b4d1e87f
|
|
@ -135,7 +135,8 @@ class Exllamav2Model:
|
|||
return result, result
|
||||
|
||||
def encode(self, string, **kwargs):
|
||||
return self.tokenizer.encode(string, add_bos=True, encode_special_tokens=True)
|
||||
add_bos = kwargs.pop('add_bos', True)
|
||||
return self.tokenizer.encode(string, add_bos=add_bos, encode_special_tokens=True, **kwargs)
|
||||
|
||||
def decode(self, ids, **kwargs):
|
||||
if isinstance(ids, list):
|
||||
|
|
|
|||
|
|
@ -316,7 +316,6 @@ class Exllamav3Model:
|
|||
return output
|
||||
|
||||
def encode(self, string, **kwargs):
|
||||
# Default add_bos to True for consistency with exllamav2 behavior
|
||||
add_bos = kwargs.pop('add_bos', True)
|
||||
return self.tokenizer.encode(string, add_bos=add_bos, **kwargs)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue