Skip to content

Instantly share code, notes, and snippets.

@r-annicet
Forked from amrrs/avoid_colab_close.js
Created December 18, 2022 10:05
Show Gist options
  • Save r-annicet/a2a5a59349ec8c77d5f73c436dcb5f3c to your computer and use it in GitHub Desktop.
Save r-annicet/a2a5a59349ec8c77d5f73c436dcb5f3c to your computer and use it in GitHub Desktop.
How to avoid Google Colab Session Closing automatically?
//credit - https://huggingface.co/blog/fine-tune-wav2vec2-english (Patrick von Platen)
// run this on your Chrome / Browser Console (where Colab is present)
function ConnectButton(){
console.log("Connect pushed");
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click()
}
var colab = setInterval(ConnectButton,60000);
// uncomment the below line and use it for clearing
//clearInterval(colab)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment