Open msciancalepore98 opened 1 month ago
OK after some more digging I found this and it actually fixes it.
multiprocessing_context="fork" if torch.backends.mps.is_available() else None
Unfortunately I must use the old .fit to use the good old dataloader interface and setting this field !
Hmm, that looks like a tricky bug. Could you perhaps use the new Trainer if you use:
class CustomTrainer(SentenceTransformerTrainer):
def get_train_dataloader(self):
dataloader = super().get_train_dataloader()
dataloader.multiprocessing_context="fork" if torch.backends.mps.is_available() else None
return dataloader
# also for eval/test dataloaders
Yeah at the end I fixed it like that, would be worth to fix it mainstream or even updating the docs? Nowadays lots of folks in companies use macbooks to do dry runs locally before going cuda mode :)
Hi,
I am trying to run a pretty simple test, with the following args:
but I got the following error:
Of course, if I switch to num_workers=0, everything works.. use_mps_device True or False makes no difference (I am doing some tests locally).
If I try with the old .fit I have:
I have torch == 2.5.0 and sentence_transformers == 3.2.1.