huggingface / setfit

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

Setfit can't doing model prediction after training for MultiClass Classification with hf Trainer #522

Open akkocz17 opened 6 months ago

akkocz17 commented 6 months ago

When I train setfit for multiclass classification using huggingface trainer which I am using save_step arguments, I can not use the model.predict() method for getting predictions. I am getting the below not fitted error. model.predict() only work when i am loading the model with save_pretrained() method, but i still can not use other saved steps models for prediction, there is only one useable model which saved with save_pretrained_method().

I did not face with the issue when train binary classification model using same setup.

setfit_issue2
kgourgou commented 6 months ago

Hello! Any chance you can provide some minimal code that replicates the issue? And also, which version of SetFit are you using?