You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation says that the path argument in the Language.save_to_directory method can be a string. However, this methods fails in such case:
File "lib/python3.6/site-packages/spacy/language.py", line 353, in save_to_directory
self.setup_directory(path, **configs)
File "lib/python3.6/site-packages/spacy/language.py", line 192, in setup_directory
directory = path / name
TypeError: unsupported operand type(s) for /: 'str' and 'str'
It works fine if the argument is a pathlib's Path.
Hmm, this is interesting! Could you share how you're calling save_to_directory(), i.e. the value you're passing in?
spaCy currently uses an ensure_path() helper function that should make sure string types are turned into pathlib paths. But somehow, this seems to fail here and returns a string...
Oh, I didn't realise this was a fix we hadn't released as part of v1.8.0 yet. The next point release will hopefully be up on pip later tonight! Sorry about the confusion.
ines
added
the
bug
Bugs and behaviour differing from documentation
label
Apr 23, 2017
Hi,
The documentation says that the
path
argument in theLanguage.save_to_directory
method can be a string. However, this methods fails in such case:It works fine if the argument is a pathlib's Path.
Your Environment
The text was updated successfully, but these errors were encountered: