How to enable colab for longer runtimes by keeping it active
This post is of help:
Steps:
- Open the inspector view by typing Ctrl+ Shift + i and then clicking on console tab at top.
- Paste the below code snippet at bottom of console and hit enter
function ClickConnect(){
console.log("Working");
document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click();
}
setInterval(ClickConnect,60000)
Above code would keep on clicking the page and prevent it from disconnecting.