We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4613a2 commit 64d474dCopy full SHA for 64d474d
1 file changed
evaluation_function/models/shannon_words_ngram.py
@@ -4,6 +4,7 @@
4
from lf_toolkit.evaluation import Result, Params
5
import random, pickle, os
6
import os
7
+import tempfile
8
from pathlib import Path
9
from io import StringIO
10
import re
@@ -27,7 +28,7 @@ def corpus_sents(): # CHANGE
27
28
MODEL_DIR = Path(os.environ.get("MODEL_DIR", BASE_DIR / "storage"))
29
MODEL_DIR.mkdir(parents=True, exist_ok=True)
30
WORD_LENGTHS_PATH = MODEL_DIR / "norvig_word_length_frequencies.csv"
-FILE = MODEL_DIR / "ngram_counts.pkl"
31
+FILE = Path(tempfile.gettempdir()) / "ngram_counts.pkl"
32
33
# If not cache:
34
def corpus_sents(): # CHANGE
0 commit comments