System Info
platform==Ubuntu 18.04.01
python==3.10
transformers==4.29.1
Who can help?
@sgugger @stevhliu @mk
Information
Tasks
Reproduction
It is shown in the OPT model documentation (in Tips) that it is required to pass use_fast=False when loading a OPT tokenizer, as OPT tokenizer will add </s> to the beginning of every prompt.
I made a trial:
>>> import transformers
>>> tokenizer = transformers.AutoTokenizer.from_pretrained("facebook/opt-1.3b", use_fast=False)
>>> tokenizer_fast = transformers.AutoTokenizer.from_pretrained("facebook/opt-1.3b", use_fast=True)
>>> text = "I like you."
>>> tokenizer(text)
>>> {'input_ids': [2, 100, 101, 47, 4], 'attention_mask': [1, 1, 1, 1, 1]}
>>> tokenizer_fast(text)
>>> {'input_ids': [2, 100, 101, 47, 4], 'attention_mask': [1, 1, 1, 1, 1]}
</s> is correctly added and no difference is observed.
Expected behavior
Is the tips wrong or in some other cases use_fast=Fast is actually required?
System Info
platform==Ubuntu 18.04.01
python==3.10
transformers==4.29.1
Who can help?
@sgugger @stevhliu @mk
Information
Tasks
examplesfolder (such as GLUE/SQuAD, ...)Reproduction
It is shown in the OPT model documentation (in Tips) that it is required to pass
use_fast=Falsewhen loading a OPT tokenizer, as OPT tokenizer will add</s>to the beginning of every prompt.I made a trial:
</s>is correctly added and no difference is observed.Expected behavior
Is the tips wrong or in some other cases
use_fast=Fastis actually required?