Merge pull request #9638 from polm/fix/optional-pretrain-path

Make Jsonl Corpus reader path optional again
This commit is contained in:
Sofie Van Landeghem 2021-11-09 10:45:14 +01:00 committed by GitHub
commit 24cdd4c88e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ def create_docbin_reader(
@util.registry.readers("spacy.JsonlCorpus.v1")
def create_jsonl_reader(
path: Union[str, Path], min_length: int = 0, max_length: int = 0, limit: int = 0
path: Optional[Union[str, Path]], min_length: int = 0, max_length: int = 0, limit: int = 0
) -> Callable[["Language"], Iterable[Example]]:
return JsonlCorpus(path, min_length=min_length, max_length=max_length, limit=limit)
@ -221,7 +221,7 @@ class JsonlCorpus:
def __init__(
self,
path: Union[str, Path],
path: Optional[Union[str, Path]],
*,
limit: int = 0,
min_length: int = 0,