Pegasus Tokenizer Error
While working with pegasus(using hugging face tranformer implimentation) I got this error… also tried to install sentencepiece library using pip… still showing the same error can anyone help?  this is my codemodel_name = ‘google/pegasus-aeslc’#'google/pegasus-xsum’torch_device = ‘cuda’ if torch.cuda.is_available() else 'cpu’tokenizer1 = PegasusTokenizer.from_pretrained(model_name)model = PegasusForConditionalGeneration.from_pretrained(model_name).to(torch_device)Error:PegasusTokenizer requires the SentencePiece library but it was not found in your environment. Checkout the instructions on theinstallation page of its repo:https://github.com/google/sentencepiece#installationand follow the onesthat match your environment.
2020-12-04T08:52:14Z
You are not showing the error, but I am having the same problem with the SentencePiece library and PegasusTokenizer.
2020-12-04T20:49:09Z
If you have same error as mine thenuse!pip install Transformers==3.2.0instead of!pip install Transformers
2020-12-07T15:43:04Z
Opening an issue on GitHub#8963
2023-06-26T22:30:51Z
Restarting the kernel and using!pip install Transformers==3.2.0instead of!pip install Transformers, worked for me
2023-12-29T03:27:05Z
Use:!pip install transformers==3.2.0
!pip install transformers[sentencepiece]
!pip install sentencepieceMake sure to restart your runtime before running again