Reputation: 998
To save consumed compute units in Colab (as there's an option) to pay as you go, how to terminate / shut down Colab session using a code programmatically?
Upvotes: 7
Views: 1511
Use the following function
from google.colab import runtime runtime.unassign()
It will delete the currently connected runtime and disconnect the notebook. It's announced here.
Upvotes: 10