gguf-py : fix SpecialVocab parsing when post_processor is null (#14330)
This commit is contained in:
parent
66aba7aca9
commit
238005c2dc
1 changed files with 72 additions and 72 deletions
|
@ -167,7 +167,7 @@ class SpecialVocab:
|
||||||
tokenizer_config['bos_token'] = special_bos = special_cls
|
tokenizer_config['bos_token'] = special_bos = special_cls
|
||||||
if not special_eos and special_sep and tokenizer_config:
|
if not special_eos and special_sep and tokenizer_config:
|
||||||
tokenizer_config['eos_token'] = special_eos = special_sep
|
tokenizer_config['eos_token'] = special_eos = special_sep
|
||||||
post_processor = tokenizer.get('post_processor', {})
|
if post_processor := tokenizer.get('post_processor'):
|
||||||
for processor in post_processor.get('processors', [post_processor]):
|
for processor in post_processor.get('processors', [post_processor]):
|
||||||
if processor.get('type') == 'RobertaProcessing':
|
if processor.get('type') == 'RobertaProcessing':
|
||||||
self.add_special_token['bos'] = True
|
self.add_special_token['bos'] = True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue