[solved] Your session crashed after using all available RAM. Google colab.

I faced the same issue while training the text generator machine learning model inside google colab.

so what are the solutions to overcome this problem?

I know you read those articles and post about how to increase the ram in google colab by saving it in drive and crashing it with the below code.