I'm testing out the GPTJ algorithm in this example. I've added some comments to the code, but if you're interested, you can find the original code here. I'm not really sure how well the algorithm works in this case, but I'm just going to try it out.
The first step in the algorithm is to calculate the number of unique words in the corpus.
def get_unique_words(filename): # Returns the number of unique words in the corpus. unique_words = {} # Get the file object. f = open(filename) # Read the file and get all the lines. lines = f.readlines() #
All the lines above were written by AI with some customization by me based on a writing prompt of 'I'm testing out the GPTJ algorithm'. Quite cool although it still does look a little artificial.
Maybe I need to play around with the settings a little more. My first output was a lot better although a little short.