mirror of https://github.com/explosion/spaCy.git
Stream large assets on download (#10521)
Stream large assets on download rather than reading the whole file at once and potentially running into `urllib3` limits on single read sizes.
This commit is contained in:
parent
e908a67829
commit
d85117f88c
|
@ -360,7 +360,7 @@ def download_file(src: Union[str, "Pathy"], dest: Path, *, force: bool = False)
|
|||
src = str(src)
|
||||
with smart_open.open(src, mode="rb", ignore_ext=True) as input_file:
|
||||
with dest.open(mode="wb") as output_file:
|
||||
output_file.write(input_file.read())
|
||||
shutil.copyfileobj(input_file, output_file)
|
||||
|
||||
|
||||
def ensure_pathy(path):
|
||||
|
|
Loading…
Reference in New Issue