Instructions to use google/ul2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/ul2 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("google/ul2") model = AutoModelForSeq2SeqLM.from_pretrained("google/ul2") - Notebooks
- Google Colab
- Kaggle
SP tokenizer missing mode tokens
#9
by keremturgutlu - opened
Simply load with sp_model = spm.SentencePieceProcessor(spiece.model) and run:
sp_model.piece_to_id("[NLG]")
sp_model.piece_to_id("[S2S]")
sp_model.piece_to_id("[NLU]")
all maps to <unk>
linking this here: https://github.com/google-research/google-research/issues/1100
It turns out that these are not special tokens in the vocab but rather plain text, e.g. like a prefix prompt. A bit wasteful I guess :)