Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created November 1, 2020 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/5b0add1333fa487c7e5759e32cf746f9 to your computer and use it in GitHub Desktop.
Save amankharwal/5b0add1333fa487c7e5759e32cf746f9 to your computer and use it in GitHub Desktop.
# to save the trained model
model.save("chat_model")
import pickle
# to save the fitted tokenizer
with open('tokenizer.pickle', 'wb') as handle:
pickle.dump(tokenizer, handle, protocol=pickle.HIGHEST_PROTOCOL)
# to save the fitted label encoder
with open('label_encoder.pickle', 'wb') as ecn_file:
pickle.dump(lbl_encoder, ecn_file, protocol=pickle.HIGHEST_PROTOCOL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment