Open LakeYin opened 5 months ago
This error is thrown even for single datasets
Same behavior with me
Hello!
Apologies for the delay, I was on vacation last week.
When you are using load_best_model_at_end=True
, then it will use metric_for_best_model
and greater_is_better
to figure out whether a certain evaluation score is better or worse than some other. When you're using a DatasetDict
, then your evaluation loss will be e.g. eval_stsb_loss
or eval_quora_loss
, instead of the default eval_loss
. In fact, the default eval_loss
won't exist, and you'll get this error.
I've just created a pull request on transformers
to give more useful errors here, indicating that you can use metric_for_best_model
in the SentenceTransformerTrainingArguments to specify which value you'd like to use.
If you're not using load_best_model_at_end=True
, then it won't need to check which checkpoint is better than another, and so it'll not give this crash. That's why you only get the error with load_best_model_at_end=True
.
I'm not sure why this error occurs with single datasets, I haven't been able to reproduce that yet.
@LakeYin @tomaarsen is the loss same in this image that you are using. Also how to use custom loss in sentence transformer.?
I think you hit sent a bit too quickly, before the image could be added to the comment correctly @imrankh46.
I think you hit sent a bit too quickly, before the image could be added to the comment correctly @imrankh46.
I just edit now you can see the image. Officially I try to chat with but not able.
I implement the loss which used by Alibaba team in the gte quen2 instruct model. But not sure how to use or add the custom loss into sentence transformer.
Next can we load peft/lora model using sentence transformer?
@tomaarsen
Answered your first question in #2774
Next can we load peft/lora model using sentence transformer?
Yes, this is possible, but only with a bit of a hacky workaround (for now). Learn more about it here: https://github.com/UKPLab/sentence-transformers/issues/2748#issuecomment-2173422897
System Information
Linux x86-64 Python 3.10.5
sentence_transformers
3.0.1transformers
4.41.2datasets
2.19.2Reproduction
Running on GPU:
Error
Notably, this error does not happen when
load_best_model_at_end=True
is removed fromargs
.