diff --git a/fastNLP/models/char_language_model.py b/fastNLP/models/char_language_model.py index a9f40ae9..f678070e 100644 --- a/fastNLP/models/char_language_model.py +++ b/fastNLP/models/char_language_model.py @@ -142,6 +142,8 @@ class CharLM(BaseModel): "char_dict": char_dict, "reverse_word_dict": reverse_word_dict, } + if not os.path.exists("cache"): + os.mkdir("cache") torch.save(objects, "cache/prep.pt") print("Preprocess done.")