FailedPreconditionError: test-trainer is not a directory

54 Views Asked by At

I am doing a Hugging Face NLP course but apparently it doesn't work

the code form HF:

from transformers import TrainingArguments

training_args = TrainingArguments("test-trainer")

from transformers import AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=2)
from transformers import Trainer

trainer = Trainer(
    model,
    training_args,
    train_dataset=tokenized_datasets["train"],
    eval_dataset=tokenized_datasets["validation"],
    data_collator=data_collator,
    tokenizer=tokenizer
)
trainer.train()

after the last string i got an error:

FailedPreconditionError: test-trainer is not a directory

searched the web and found nothing on it :( (maybe i'm blind)

0

There are 0 best solutions below