Instructions to use google/flan-ul2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/flan-ul2 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("google/flan-ul2") model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-ul2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Set tokenizer model_max_length to 2048
Browse filesAs described in the FLAN-UL2 blog, the receptive field of the model was increased from 512 to 2048.
There is also a `n_positions` in the model config, set to 512, but I can't see its use in `transformers` 🤔
102 unmodified lines103104105106107108109102 unmodified lines],"eos_token": "</s>","extra_ids": 100,"model_max_length": 512,"name_or_path": "google/ul2","pad_token": "<pad>","special_tokens_map_file": null,102 unmodified lines103104105106107108109102 unmodified lines],"eos_token": "</s>","extra_ids": 100,"model_max_length": 2048,"name_or_path": "google/ul2","pad_token": "<pad>","special_tokens_map_file": null,
tokenizer_config.json+1-1