add function to train multi model parallism