Restore model without the data

After doing

learner.save_encoder(‘adam3_10_enc’)

How can I restore the learner in another notebook at a different time.

I can do

learner.load_encoder(‘adam3_10_enc’)

But how do I first create learner.

In the notebook lesson4-imdb.ipynb learner is created from model data.

md.get_model(...)

But that means to restore the learner I first need to create model data using

md = LanguageModelData.from_text_files(PATH, TEXT, **FILES, bs=bs, bptt=bptt, min_freq=10)

I don’t understand when I have trained the weights then why do I need to keep the data still to restore the model weights. I should be able to create a learner and just load these weights back. NN are parametric models afterall!

I must be missing something obvious. If someone can point please.

ModelData gives you TEXT.vocab which stores how each word is mapped into an integer

But we are picking TEXT field separately.

Are you saying I need to necessarily create the model data and hence need to keep the data to create a learner? That is not a feasible approach for inference.