Pycharm debugging with extra terminal script and parameters
How to debug the file `train.py` that need to run with following terminal script using Pycharm, e.g.
```
python -m torch.distributed.launch --nproc_per_node=2 train.py --param1 --param2
```
Please sign in to leave a comment.
You can add interpreter options as well as script parameters to the run/debug configuration. Have you tried it?
https://www.jetbrains.com/help/pycharm/creating-and-editing-run-debug-configurations.html
I am running python script like this is terminal. How can I debug in python.
--nproc_per_node 1 example_text_completion.py --ckpt_dir Llama-2-7b/ --tokenizer_path Llama-2-7b/tokenizer.model --max_seq_len 128 --max_batch_size 4
I added - m torch.distributed.launch in the debug configuration but its giving error as -m is not a valid argument to the script.
Have you tried attaching to a process or python debug server?