0
最常见的方法是使用pickle或joblib。下面是一个有关如何使用pickle保存Tokenizer的示例:
import pickle
# savingwith open('tokenizer.pickle', 'wb') as handle:
pickle.dump(tokenizer, handle, protocol=pickle.HIGHEST_PROTOCOL)
# loadingwith open('tokenizer.pickle', 'rb') as handle:
tokenizer = pickle.load(handle)
收藏