File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 44Copyright by the AllenNLP authors.
55"""
66
7+ import asyncio
78import copy
89import glob
910import io
2021import warnings
2122import xml .dom .minidom
2223import zipfile
23- from asyncio import TimeoutError
2424from contextlib import closing , contextmanager
2525from functools import partial
2626from io import BytesIO
3131from urllib .parse import urljoin , urlparse
3232from xml .etree import ElementTree as ET
3333
34+ import aiohttp .client_exceptions
3435import fsspec
3536import huggingface_hub
3637import requests
37- from aiohttp .client_exceptions import ClientError
3838from fsspec .core import strip_protocol , url_to_fs
3939from fsspec .utils import can_be_local
4040from huggingface_hub .utils import EntryNotFoundError , insecure_hashlib
@@ -1103,7 +1103,12 @@ def read_with_retries(*args, **kwargs):
11031103 try :
11041104 out = read (* args , ** kwargs )
11051105 break
1106- except (ClientError , TimeoutError ) as err :
1106+ except (
1107+ aiohttp .client_exceptions .ClientError ,
1108+ asyncio .TimeoutError ,
1109+ requests .exceptions .ConnectTimeout ,
1110+ requests .exceptions .ConnectionError ,
1111+ ) as err :
11071112 disconnect_err = err
11081113 logger .warning (
11091114 f"Got disconnected from remote data host. Retrying in { config .STREAMING_READ_RETRY_INTERVAL } sec [{ retry } /{ max_retries } ]"
You can’t perform that action at this time.
0 commit comments