Browse Source

fix a bug in char_language_model.py

tags/v0.1.0
xuyige 6 years ago
parent
commit
c77621292b
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      fastNLP/models/char_language_model.py

+ 2
- 0
fastNLP/models/char_language_model.py View File

@@ -142,6 +142,8 @@ class CharLM(BaseModel):
"char_dict": char_dict, "char_dict": char_dict,
"reverse_word_dict": reverse_word_dict, "reverse_word_dict": reverse_word_dict,
} }
if not os.path.exists("cache"):
os.mkdir("cache")
torch.save(objects, "cache/prep.pt") torch.save(objects, "cache/prep.pt")
print("Preprocess done.") print("Preprocess done.")




Loading…
Cancel
Save