huggingface / setfit

Efficient few-shot learning with Sentence Transformers
https://hf.co/docs/setfit
Apache License 2.0
2.24k stars 223 forks source link

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

Open Rashie opened 9 months ago

Rashie commented 9 months ago

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?

tomaarsen commented 9 months ago

Hello!

Could you please share your transformers version? pip show transformers

Rashie commented 9 months ago
image
tomaarsen commented 9 months ago

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'"?