Colab can not connect to GPU from a python file
Why dont you import the file into notebook and run your function.

Eg: if your example.py has something like this

if __name__ == '__main__':
    myfunction()


Then in your colab,

import os
os.chdir("path/to/cloned/dir/")
import example
example.myfunction()