setfit icon indicating copy to clipboard operation
setfit copied to clipboard

Unable to run Text-Classification task because of error related to 'experiment_name'

Open Rashie opened this issue 1 year ago • 3 comments

I am loading this pre-trained model, model = SetFitModel.from_pretrained("all-MiniLM-L6-v2")

and tuning with new data

train_ds = my_dataset_dict["train"] val_ds = my_dataset_dict["val"] eval_ds= my_dataset_dict["eval"]

args = TrainingArguments( batch_size=64, num_epochs=2, # The number of epochs to use for constrastive learning num_iterations=70, # The number of text pairs to generate for contrastive learning loss=CosineSimilarityLoss, evaluation_strategy="epoch", save_strategy="epoch", load_best_model_at_end=True, #exp_name = 'exp_1'

)

trainer = Trainer( model=model, args=args, train_dataset=train_ds, eval_dataset=val_ds, metric="accuracy", column_mapping={"text": "text", "label": "label"} # Map dataset columns to text/label expected by trainer )

when I run trainer.train() i am getting error "TypeError: init() missing 1 required positional argument: 'experiment_name'"

I am not sure where i need to define this, i tried setting this param in trainer class and TrainerArguments class, but seems like they do not take a param like this. Can you please help?

Rashie avatar Feb 05 '24 16:02 Rashie

Hello!

Could you please share your transformers version? pip show transformers

  • Tom Aarsen

tomaarsen avatar Feb 05 '24 18:02 tomaarsen

image

Rashie avatar Feb 05 '24 18:02 Rashie

I'm unable to reproduce this right now, could you provide a more detailed stack trace that leads to "TypeError: init() missing 1 required positional argument: 'experiment_name'"?

  • Tom Aarsen

tomaarsen avatar Feb 06 '24 11:02 tomaarsen