Skip to content

Quote Generation using ML for Machine Learning Class at the University of Kentucky

Notifications You must be signed in to change notification settings

mentaldropouts/Quote-Generation-ML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quote Generation with GPT-2

Overview

This program uses the GPT-2 language model to generate quotes based on the provided input. It is designed to run in Google Colab.

Getting Started

1. Prerequisites

  • Google Colab account

2. Setup

2.1. Google Drive

Upload the files model.py and generate.py into the MyDrive location of your Google Drive(don't place it in a folder)

2.2. Google Colab

  • 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"

3. Customize

  • 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

4. Run

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.

Tips

  • Feel free to experiment with different prompts, hyperparameters, or GPT-2 model sizes for varied results.
  • Larger datasets may improve model performance.

Note

  • 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!

About

Quote Generation using ML for Machine Learning Class at the University of Kentucky

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •