File size: 4,045 Bytes
76d6ddf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | # Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
# ruff: noqa: F401
from huggingface_hub.errors import (
BadRequestError,
BucketNotFoundError,
CacheNotFound,
CorruptedCacheException,
DisabledRepoError,
EntryNotFoundError,
FileMetadataError,
GatedRepoError,
HfHubHTTPError,
HFValidationError,
JobNotFoundError,
LocalEntryNotFoundError,
LocalTokenNotFoundError,
NotASafetensorsRepoError,
OfflineModeIsEnabled,
RepositoryNotFoundError,
RevisionNotFoundError,
SafetensorsParsingError,
)
from . import tqdm as _tqdm # _tqdm is the module
from ._auth import get_stored_tokens, get_token
from ._cache_assets import cached_assets_path
from ._cache_manager import (
CachedFileInfo,
CachedIncompleteFileInfo,
CachedRepoInfo,
CachedRevisionInfo,
DeleteCacheStrategy,
HFCacheInfo,
_format_size,
scan_cache_dir,
)
from ._chunk_utils import chunk_iterable
from ._datetime import parse_datetime
from ._detect_agent import detect_agent, is_agent
from ._experimental import experimental
from ._fixes import SoftTemporaryDirectory, WeakFileLock, yaml_dump
from ._git_credential import list_credential_helpers, set_git_credential, unset_git_credential
from ._headers import build_hf_headers, get_token_to_send
from ._hf_uris import HfMount, HfUri, is_hf_uri, parse_hf_mount, parse_hf_uri
from ._http import (
ASYNC_CLIENT_FACTORY_T,
CLIENT_FACTORY_T,
RateLimitInfo,
close_session,
fix_hf_endpoint_in_url,
get_async_session,
get_session,
hf_raise_for_status,
http_backoff,
http_stream_backoff,
parse_ratelimit_headers,
set_async_client_factory,
set_client_factory,
)
from ._pagination import paginate
from ._paths import DEFAULT_IGNORE_PATTERNS, FORBIDDEN_FOLDERS, filter_repo_objects
from ._runtime import (
dump_environment_info,
get_aiohttp_version,
get_fastai_version,
get_fastapi_version,
get_fastcore_version,
get_gradio_version,
get_graphviz_version,
get_hf_hub_version,
get_jinja_version,
get_numpy_version,
get_pillow_version,
get_pydantic_version,
get_pydot_version,
get_python_version,
get_tensorboard_version,
get_tf_version,
get_torch_version,
installation_method,
is_aiohttp_available,
is_colab_enterprise,
is_fastai_available,
is_fastapi_available,
is_fastcore_available,
is_google_colab,
is_gradio_available,
is_graphviz_available,
is_jinja_available,
is_notebook,
is_numpy_available,
is_package_available,
is_pillow_available,
is_pydantic_available,
is_pydot_available,
is_safetensors_available,
is_tensorboard_available,
is_tf_available,
is_torch_available,
)
from ._safetensors import SafetensorsFileMetadata, SafetensorsRepoMetadata, TensorInfo
from ._subprocess import capture_output, run_interactive_subprocess, run_subprocess
from ._telemetry import send_telemetry
from ._terminal import ANSI, StatusLine, select_choice, tabulate
from ._typing import is_jsonable, is_simple_optional_type, unwrap_simple_optional_type
from ._validators import validate_hf_hub_args, validate_repo_id
from ._xet import (
XetFileData,
XetTokenType,
parse_xet_file_data_from_response,
)
from .tqdm import (
are_progress_bars_disabled,
disable_progress_bars,
enable_progress_bars,
hf_thread_map,
is_tqdm_disabled,
silent_tqdm,
tqdm,
tqdm_stream_file,
)
|