How can I use a pretrained model for a language model learner?

In the past, you were able to do something like

learn = language_model_learner(data_lm, pretrained_model=URLs.WT103, drop_mult=0.3)

however, the API has changed and I can’t find in the docs on how to load a pretrained model. The closest I got was

learn = language_model_learner(data_lm, AWD_LSTM, pretrained_fnames=URLs.WT103, pretrained=True, drop_mult=.3)

which then looks for a models/t.pkl file which I don’t have.

I’ve found the fastai docs website to be very helpful in answering questions like this - I’ve had similar and still am learning more about the language model learner. Take a look at https://docs.fast.ai/text.learner.html#language_model_learner for high level details on how the language_model_learner works.

The function definition says that pretrained defaults to True and pretrained_fnames defaults to None. When looking at the source code for the language_model_learner available here:

It shows that if you don’t pass in a pretrained model, one is loaded by default (if you are using the AWD_LSTM or Transformer architectures.)