Can I use fine-tuned LMs to generate text?

Hi,
In DL 2 course, there is a classification task, which uses a pre-trained language model, fine tune it and then for classification.

Can I use it for the following scenario, if yes how (in pytorch or fastai)?: [Based on my search, I could not find any methods for it]

  1. Fine-tune the pre-trained language model on my own text corpus and then generate(sample) text.
  2. Fine-tune the pre-trained language model on my own text corpus and then score any given text/sentence.
    Thanks.

I am new in fastai, but am using this method to generate text:

`TEXT = "think" #the word you are going to feed to the network `
`N_WORDS = 30 #nmuber of words in a sentence`
`N_SENTENCES = 10 #num of sentences to generate`
`print("\n".join(learn.predict(TEXT, N_WORDS, temperature=0.3) for _ in `
`range(N_SENTENCES)))`