High-quality text generation requires large-size pretrained language models like BERT or GPT-3. You should not use any code examples older than 1-2 years if you want to implement the model to write TV scripts or any other literary texts.
Depending on the size of RAM on your computer, it might be the case that not all state of the art models could be used for text generation on your PC. Check the size of the model and take into account that for prediction on any input data it will require even mode space. Try using Google Colab first.
Pretrained models could be found at TensorFlow Hub 1
Also you can check out transformers library. It allows to download many models in tensorflow format or use them via simple pipeline. For text generation you can try GPT Neo (GPT Neo — transformers 4.10.0 documentation 2).