diff --git a/bin/init_model.py b/bin/init_model.py index 2591ada50..fe65cd309 100644 --- a/bin/init_model.py +++ b/bin/init_model.py @@ -90,6 +90,9 @@ def _read_probs(loc): def _read_freqs(loc): + if not loc.exists(): + print("Warning: Frequencies file not found") + return None counts = PreshCounter() total = 0 for i, line in enumerate(loc.open()): diff --git a/requirements.txt b/requirements.txt index 7a5292e96..bf10a1165 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ cython cymem == 1.11 pathlib -preshed == 0.37 +preshed == 0.41 thinc == 3.3 murmurhash == 0.24 unidecode diff --git a/setup.py b/setup.py index 36f43a296..15c850627 100644 --- a/setup.py +++ b/setup.py @@ -119,7 +119,7 @@ def run_setup(exts): "spacy.syntax": ["*.pxd"]}, ext_modules=exts, license="Dual: Commercial or AGPL", - install_requires=['numpy', 'murmurhash', 'cymem >= 1.11', 'preshed == 0.37', + install_requires=['numpy', 'murmurhash', 'cymem >= 1.11', 'preshed == 0.41', 'thinc == 3.3', "unidecode", 'wget', 'plac', 'six', 'ujson'], setup_requires=["headers_workaround"], diff --git a/spacy/cfile.pyx b/spacy/cfile.pyx index 6346302b9..781759466 100644 --- a/spacy/cfile.pyx +++ b/spacy/cfile.pyx @@ -5,6 +5,8 @@ cdef class CFile: def __init__(self, loc, mode): if isinstance(mode, unicode): mode_str = mode.encode('ascii') + else: + mode_str = mode cdef bytes bytes_loc = loc.encode('utf8') if type(loc) == unicode else loc self.fp = fopen(bytes_loc, mode_str) if self.fp == NULL: