Instructions to use google/flan-t5-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/flan-t5-base with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-base") model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-base") - Notebooks
- Google Colab
- Kaggle
Issues in fine tuning flan T5 model?
#13
by mihirinamdar - opened
Tokenize input data
text = "Sample text for fine-tuning flan t5 base model." inputs = tokenizer.encode(text, return_tensors='pt')
Prepare labels
labels = inputs.clone()
labels[0, :-1] = labels[0, 1:]
It should work but I got this error: RuntimeError Traceback (most recent call last) in 5 # Prepare labels 6 labels = inputs.clone() ----> 7 labels[0, :-1] = labels[0, 1:]
RuntimeError: unsupported operation: some elements of the input tensor and the written-to tensor refer to a single memory location. Please clone() the tensor before performing the operation.
Can somebody help fix this issue? Thank you