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

Data validation when using differentiable_head #513

Open stephantul opened 7 months ago

stephantul commented 7 months ago

Hi,

Thanks for the great package. I was training a model with the default settings, which went great. I then switched to a differentiable head, which crashed because I used string labels and didn't specify the number of classes. My bad! I should've read the docs.

However, I think it would be nice if it crashed immediately, and not after the fine-tuning stage. I think the dataset parameters could be checked, or even converted automatically:

I'd definitely be willing to do a PR, but only if you think it makes sense.