fix adding .spacy suffix

This commit is contained in:
kadarakos 2022-11-22 17:10:18 +00:00
parent 0fd265e3f3
commit b5e08e24bd

View File

@ -133,5 +133,5 @@ def apply(
for doc in tqdm.tqdm(nlp.pipe(datagen, batch_size=batch_size, n_process=n_process)):
docbin.add(doc)
if output_file.suffix == "":
output_file += ".spacy"
output_file = output_file.with_suffix(".spacy")
docbin.to_disk(output_file)