Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions medcat-v2/medcat/tokenizing/spacy_impl/tokenizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,9 @@ def save_internals_to(self, folder_path: str) -> str:
folder_path, f"{TOKENIZER_PREFIX}{self._spacy_model_name}")
if os.path.exists(subfolder):
# NOTE: always overwrite
shutil.rmtree(folder_path)
shutil.rmtree(subfolder)
logger.debug("Saving spacy model to '%s'", subfolder)
cur_path = self._nlp._path
if cur_path is None:
raise ValueError(f"Unable to save spacy: {self._nlp}")
shutil.copytree(cur_path, subfolder)
self._nlp.to_disk(subfolder)
return subfolder

def load_internals_from(self, folder_path: str) -> bool:
Expand Down
Loading