Skip to content

Commit

Permalink
refactor: Add multiprocessing context to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
cauliyang committed Nov 4, 2024
1 parent d53c716 commit e69c335
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deepchopper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ def predict(
logger=False,
limit_predict_batches=limit_predict_batches,
)

import multiprocess.context as ctx

ctx._force_start_method("spawn")
trainer.predict(model=model, dataloaders=datamodule, return_predictions=False)


Expand Down

0 comments on commit e69c335

Please sign in to comment.