TypeError: 'TensorSliceDataset' object is not subscriptable

#3
by codkiller0911 - opened

I'm trying to fine-tune the model using my own dataset. When running the train() method, I get the following error: TypeError: 'TensorSliceDataset' object is not subscriptable

I suppose it is due to the type of dataset given to the Trainer (TensorSliceDataset).

train_dataset = tf.data.Dataset.from_tensor_slices((
dict(train_encodings),
train_message
))

test_dataset = tf.data.Dataset.from_tensor_slices((
dict(val_encodings),
val_message
))

args = TrainingArguments(
output_dir="output",
num_train_epochs=1,
per_device_train_batch_size=8

)
trainer = Trainer(
model=model,
args=args,
train_dataset=train_dataset,
eval_dataset=test_dataset,
compute_metrics=compute_metrics
)

have same issue

Sign up or log in to comment