There is probably a hard-coded device .cuda() in some part of the code.
If you don’t want to inspect the code, you can run
CUDA_VISIBLE_DEVICES=1 python path_to_the_file.py
This environment variable will make that python program to consider the only gpu is the gpu 1.