File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 4
4
Copyright by the AllenNLP authors.
5
5
"""
6
6
7
+ import asyncio
7
8
import copy
8
9
import glob
9
10
import io
20
21
import warnings
21
22
import xml .dom .minidom
22
23
import zipfile
23
- from asyncio import TimeoutError
24
24
from contextlib import closing , contextmanager
25
25
from functools import partial
26
26
from io import BytesIO
31
31
from urllib .parse import urljoin , urlparse
32
32
from xml .etree import ElementTree as ET
33
33
34
+ import aiohttp .client_exceptions
34
35
import fsspec
35
36
import huggingface_hub
36
37
import requests
37
- from aiohttp .client_exceptions import ClientError
38
38
from fsspec .core import strip_protocol , url_to_fs
39
39
from fsspec .utils import can_be_local
40
40
from huggingface_hub .utils import EntryNotFoundError , insecure_hashlib
@@ -1093,7 +1093,12 @@ def read_with_retries(*args, **kwargs):
1093
1093
try :
1094
1094
out = read (* args , ** kwargs )
1095
1095
break
1096
- except (ClientError , TimeoutError ) as err :
1096
+ except (
1097
+ aiohttp .client_exceptions .ClientError ,
1098
+ asyncio .TimeoutError ,
1099
+ requests .exceptions .ConnectTimeout ,
1100
+ requests .exceptions .ConnectionError ,
1101
+ ) as err :
1097
1102
disconnect_err = err
1098
1103
logger .warning (
1099
1104
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