Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry on HF Hub error when streaming #6844

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/datasets/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from aiohttp.client_exceptions import ClientError
from fsspec.core import strip_protocol, url_to_fs
from fsspec.utils import can_be_local
from huggingface_hub.utils import EntryNotFoundError, insecure_hashlib
from huggingface_hub.utils import EntryNotFoundError, HfHubHTTPError, insecure_hashlib
from packaging import version

from .. import __version__, config
Expand Down Expand Up @@ -1100,7 +1100,7 @@ def read_with_retries(*args, **kwargs):
try:
out = read(*args, **kwargs)
break
except (ClientError, TimeoutError) as err:
except (HfHubHTTPError, ClientError, TimeoutError) as err:
disconnect_err = err
logger.warning(
f"Got disconnected from remote data host. Retrying in {config.STREAMING_READ_RETRY_INTERVAL}sec [{retry}/{max_retries}]"
Expand Down
Loading