You can create a copy of this file 24 and customize it the way you want. Here 18 this module  will spawn parallel processes according to their rank. You could arrange your script so that the cmd could look like cmd = python -m detector.script --local_rank --arg1 --arg2 ....