What do you mean by joint training?
Are the networks totally independent?
Does the sum of losses make sense in any way?
If you just want to train two different models you can run two different scripts. No need to run them in the same script.
Both codes will “run”, the difference is the theory in behind depending on what you are doing.