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

Sign up or log in to comment