You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that the current solution (that i found the hard way) that is suggested in the issues is to subclass SentenceTransformerTrainer and override get_batch_sampler, is not documented well enough and isn't straightforward
Is there any reason not to just accept anything that inherits from DefaultBatchSampler (for example) as a parameter?
The text was updated successfully, but these errors were encountered:
Having said that, the transformersTrainer class does accept an optimizers instance where you can pass initialized instances.
I think I would be okay with updating the API such that a subclass of DefaultBatchSampler can be used. We'd first have to extend DefaultBatchSampler so it also accepts valid_label_columns and generator (but keeps them unused), and then people who subclass it can use those still.
I think I can have a look at this soon.
Definitely!
If possible, perhaps the updated DefaultBatchSampler can be the superclass of the other batch samplers as well - that would make it more obvious that it should be subclassed.
If you're interested, we can also apply this approach for the multi-dataset batch samplers.
Currently only specific
batch_sampler
values are possibleThere seems to be a need to enable users to create custom batch samplers
Examples from issues:
I believe that the current solution (that i found the hard way) that is suggested in the issues is to subclass
SentenceTransformerTrainer
and overrideget_batch_sampler
, is not documented well enough and isn't straightforwardIs there any reason not to just accept anything that inherits from
DefaultBatchSampler
(for example) as a parameter?The text was updated successfully, but these errors were encountered: