This program uses the GPT-2 language model to generate quotes based on the provided input. It is designed to run in Google Colab.
- Google Colab account
Upload the files model.py and generate.py into the MyDrive location of your Google Drive(don't place it in a folder)
- Open the CS460.ipynb in Google Colab.
- Make sure the Google Drive in which you run the Colab Notebook is the same drive in which model.py and generate.py are stored
- Before starting, make sure to have your runtime type set to "T4 GPU"
- Adjust the number of quotes used to train the model by modifying the nrows variable in the pandas.read_csv cell
- Change k and length to play around with the quality of quotes generated
Run the notebook cells sequentially to train the GPT-2 model and generate quotes. When asked for user input, click next to the prompt and enter a couple words or a topic that will be the start off the generated quote.
- Feel free to experiment with different prompts, hyperparameters, or GPT-2 model sizes for varied results.
- Larger datasets may improve model performance.
- After running this code, there will be a new folder in your Drive called model. You may delete it afterwards to free space
- This README assumes basic familiarity with Google Colab.
Happy quoting!