From 480a3bf3be2fe0b1ceeb5281dc4b68ff023c0b97 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Tue, 15 Jun 2021 14:55:15 +0200 Subject: [PATCH] Make JsonlReader path optional (#8396) To avoid config errors during training when `[corpora.pretrain.path]` is `None` with the default `spacy.JsonlCorpus.v1` reader, make the reader path optional, similar to `spacy.Corpus.v1`. --- spacy/training/corpus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/training/corpus.py b/spacy/training/corpus.py index 063d80a95..1edc4329b 100644 --- a/spacy/training/corpus.py +++ b/spacy/training/corpus.py @@ -41,7 +41,7 @@ def create_docbin_reader( @util.registry.readers("spacy.JsonlCorpus.v1") def create_jsonl_reader( - path: Path, min_length: int = 0, max_length: int = 0, limit: int = 0 + path: Optional[Path], min_length: int = 0, max_length: int = 0, limit: int = 0 ) -> Callable[["Language"], Iterable[Doc]]: return JsonlCorpus(path, min_length=min_length, max_length=max_length, limit=limit)