Query re-loading text model

In a kaggle kernel, for text data, I am using “text_classifier_learner” to create the learner object and do the training. I save the learner using learn.save_encoder(‘trained_model’)

I want to load this model in another Kaggle kernel (without internet connection). How do I do this?

Using TextLearner.load_encoder(“model.pth”) gives load_encoder() missing 1 required positional argument: ‘self’.

Create the model, and then load the weights.

learn = text_classifier_learner(dls, **)

Also, you need to save the entire model, not just the encoder.