hfutils 0.2.7__tar.gz → 0.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hfutils-0.2.7/hfutils.egg-info → hfutils-0.2.9}/PKG-INFO +8 -8
- hfutils-0.2.9/hfutils/cache/__init__.py +7 -0
- hfutils-0.2.9/hfutils/cache/delete.py +151 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/config/meta.py +1 -1
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/index/__init__.py +1 -1
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/index/fetch.py +270 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/index/make.py +3 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/index/validate.py +10 -0
- hfutils-0.2.9/hfutils/utils/irregular_repo.json +5 -0
- {hfutils-0.2.7 → hfutils-0.2.9/hfutils.egg-info}/PKG-INFO +8 -8
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils.egg-info/SOURCES.txt +2 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils.egg-info/requires.txt +1 -1
- {hfutils-0.2.7 → hfutils-0.2.9}/requirements.txt +1 -1
- hfutils-0.2.7/hfutils/utils/irregular_repo.json +0 -247
- {hfutils-0.2.7 → hfutils-0.2.9}/LICENSE +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/MANIFEST.in +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/README.md +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/__init__.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/__main__.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/archive/__init__.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/archive/base.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/archive/rar.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/archive/sevenz.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/archive/tar.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/archive/zip.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/config/__init__.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/entry/__init__.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/entry/base.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/entry/cli.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/entry/dispatch.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/entry/download.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/entry/ls.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/entry/ls_repo.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/entry/upload.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/entry/whoami.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/index/hash.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/operate/__init__.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/operate/base.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/operate/download.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/operate/upload.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/operate/validate.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/utils/__init__.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/utils/binary.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/utils/download.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/utils/path.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/utils/temp.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/utils/tqdm_.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils/utils/walk.py +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils.egg-info/dependency_links.txt +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils.egg-info/entry_points.txt +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/hfutils.egg-info/top_level.txt +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/requirements-7z.txt +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/requirements-build.txt +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/requirements-doc.txt +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/requirements-rar.txt +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/requirements-test.txt +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/requirements-transfer.txt +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/setup.cfg +0 -0
- {hfutils-0.2.7 → hfutils-0.2.9}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hfutils
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
4
4
|
Summary: Useful utilities for huggingface
|
|
5
5
|
Home-page: https://github.com/deepghs/hfutils
|
|
6
6
|
Author: narugo1992
|
|
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
20
20
|
Requires-Python: >=3.8
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: hbutils>=0.9.
|
|
23
|
+
Requires-Dist: hbutils>=0.9.3
|
|
24
24
|
Requires-Dist: huggingface_hub>=0.23
|
|
25
25
|
Requires-Dist: tqdm
|
|
26
26
|
Requires-Dist: requests
|
|
@@ -30,6 +30,8 @@ Requires-Dist: natsort
|
|
|
30
30
|
Provides-Extra: build
|
|
31
31
|
Requires-Dist: pyinstaller<5,>=4.7; extra == "build"
|
|
32
32
|
Requires-Dist: setuptools<70; extra == "build"
|
|
33
|
+
Provides-Extra: transfer
|
|
34
|
+
Requires-Dist: hf-transfer; extra == "transfer"
|
|
33
35
|
Provides-Extra: doc
|
|
34
36
|
Requires-Dist: Jinja2>=3.0.0; extra == "doc"
|
|
35
37
|
Requires-Dist: sphinx>=3.2.0; extra == "doc"
|
|
@@ -50,10 +52,8 @@ Requires-Dist: ipykernel>=6.15; extra == "doc"
|
|
|
50
52
|
Requires-Dist: py-cpuinfo>=8.0.0; extra == "doc"
|
|
51
53
|
Requires-Dist: click>=7.0.0; extra == "doc"
|
|
52
54
|
Requires-Dist: pandas; extra == "doc"
|
|
53
|
-
Provides-Extra:
|
|
54
|
-
Requires-Dist:
|
|
55
|
-
Provides-Extra: transfer
|
|
56
|
-
Requires-Dist: hf-transfer; extra == "transfer"
|
|
55
|
+
Provides-Extra: rar
|
|
56
|
+
Requires-Dist: rarfile; extra == "rar"
|
|
57
57
|
Provides-Extra: test
|
|
58
58
|
Requires-Dist: coverage>=5; extra == "test"
|
|
59
59
|
Requires-Dist: mock>=4.0.3; extra == "test"
|
|
@@ -71,8 +71,8 @@ Requires-Dist: testtools>=2; extra == "test"
|
|
|
71
71
|
Requires-Dist: where>=1.0.2; extra == "test"
|
|
72
72
|
Requires-Dist: responses>=0.20.0; extra == "test"
|
|
73
73
|
Requires-Dist: natsort; extra == "test"
|
|
74
|
-
Provides-Extra:
|
|
75
|
-
Requires-Dist:
|
|
74
|
+
Provides-Extra: 7z
|
|
75
|
+
Requires-Dist: py7zr; extra == "7z"
|
|
76
76
|
|
|
77
77
|
# hfutils
|
|
78
78
|
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from functools import partial
|
|
3
|
+
from typing import Optional, Callable
|
|
4
|
+
|
|
5
|
+
from huggingface_hub import scan_cache_dir, CachedRepoInfo, CachedRevisionInfo, DeleteCacheStrategy
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def _collect_revisions(fn: Callable[[CachedRepoInfo, CachedRevisionInfo], bool], cache_dir: Optional[str] = None) \
|
|
9
|
+
-> DeleteCacheStrategy:
|
|
10
|
+
"""
|
|
11
|
+
Collects revisions from the cache that match a specific condition defined by the function `fn`.
|
|
12
|
+
|
|
13
|
+
:param fn: A callable that takes a CachedRepoInfo and CachedRevisionInfo and returns a boolean.
|
|
14
|
+
If True, the revision matches the condition.
|
|
15
|
+
:type fn: Callable[[CachedRepoInfo, CachedRevisionInfo], bool]
|
|
16
|
+
:param cache_dir: The directory where the cache is stored. If None, uses the default directory.
|
|
17
|
+
:type cache_dir: Optional[str]
|
|
18
|
+
:return: A strategy for deleting the collected revisions.
|
|
19
|
+
:rtype: DeleteCacheStrategy
|
|
20
|
+
"""
|
|
21
|
+
revision_hashes = set()
|
|
22
|
+
scan = scan_cache_dir(cache_dir=cache_dir)
|
|
23
|
+
for repo in scan.repos:
|
|
24
|
+
for revision in repo.revisions:
|
|
25
|
+
if fn(repo, revision):
|
|
26
|
+
revision_hashes.add(revision.commit_hash)
|
|
27
|
+
logging.info(f'Revisions to delete from huggingface cache: {sorted(revision_hashes)}')
|
|
28
|
+
return scan.delete_revisions(*revision_hashes)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _is_repo_match(repo: CachedRepoInfo, repo_id: Optional[str] = None, repo_type: Optional[str] = None) -> bool:
|
|
32
|
+
"""
|
|
33
|
+
Checks if a repository matches the specified ID and type.
|
|
34
|
+
|
|
35
|
+
:param repo: The repository information.
|
|
36
|
+
:type repo: CachedRepoInfo
|
|
37
|
+
:param repo_id: The ID of the repository to match. If None, matches any ID.
|
|
38
|
+
:type repo_id: Optional[str]
|
|
39
|
+
:param repo_type: The type of the repository to match. If None, matches any type.
|
|
40
|
+
:type repo_type: Optional[str]
|
|
41
|
+
:return: True if the repository matches the conditions, False otherwise.
|
|
42
|
+
:rtype: bool
|
|
43
|
+
"""
|
|
44
|
+
if repo_id and repo_type:
|
|
45
|
+
return repo.repo_id == repo_id and repo.repo_type == repo_type
|
|
46
|
+
elif repo_id:
|
|
47
|
+
return repo.repo_id == repo_id
|
|
48
|
+
elif repo_type:
|
|
49
|
+
return repo.repo_type == repo_type
|
|
50
|
+
else:
|
|
51
|
+
return True
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _is_detached_revision(
|
|
55
|
+
repo: CachedRepoInfo, revision: CachedRevisionInfo,
|
|
56
|
+
repo_id: Optional[str] = None, repo_type: Optional[str] = None,
|
|
57
|
+
) -> bool:
|
|
58
|
+
"""
|
|
59
|
+
Determines if a revision is detached (no references) and matches the specified repository ID and type.
|
|
60
|
+
|
|
61
|
+
:param repo: The repository information.
|
|
62
|
+
:type repo: CachedRepoInfo
|
|
63
|
+
:param revision: The revision information.
|
|
64
|
+
:type revision: CachedRevisionInfo
|
|
65
|
+
:param repo_id: The repository ID to match. If None, matches any ID.
|
|
66
|
+
:type repo_id: Optional[str]
|
|
67
|
+
:param repo_type: The repository type to match. If None, matches any type.
|
|
68
|
+
:type repo_type: Optional[str]
|
|
69
|
+
:return: True if the revision is detached and matches the repository conditions, False otherwise.
|
|
70
|
+
:rtype: bool
|
|
71
|
+
"""
|
|
72
|
+
if len(revision.refs) == 0:
|
|
73
|
+
return _is_repo_match(repo, repo_id, repo_type)
|
|
74
|
+
else:
|
|
75
|
+
return False
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def delete_detached_cache(
|
|
79
|
+
repo_id: Optional[str] = None, repo_type: Optional[str] = None,
|
|
80
|
+
cache_dir: Optional[str] = None
|
|
81
|
+
):
|
|
82
|
+
"""
|
|
83
|
+
Deletes all detached revisions from the cache that match the specified repository ID and type.
|
|
84
|
+
|
|
85
|
+
:param repo_id: The repository ID to match. If None, matches any ID.
|
|
86
|
+
:type repo_id: Optional[str]
|
|
87
|
+
:param repo_type: The repository type to match. If None, matches any type.
|
|
88
|
+
:type repo_type: Optional[str]
|
|
89
|
+
:param cache_dir: The directory where the cache is stored. If None, uses the default directory.
|
|
90
|
+
:type cache_dir: Optional[str]
|
|
91
|
+
"""
|
|
92
|
+
# noinspection PyTypeChecker
|
|
93
|
+
strategy = _collect_revisions(
|
|
94
|
+
fn=partial(
|
|
95
|
+
_is_detached_revision,
|
|
96
|
+
repo_id=repo_id,
|
|
97
|
+
repo_type=repo_type,
|
|
98
|
+
),
|
|
99
|
+
cache_dir=cache_dir,
|
|
100
|
+
)
|
|
101
|
+
logging.info(f'{strategy.expected_freed_size_str} space will be freed.')
|
|
102
|
+
strategy.execute()
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _is_selected_revision(
|
|
106
|
+
repo: CachedRepoInfo, revision: CachedRevisionInfo,
|
|
107
|
+
repo_id: Optional[str] = None, repo_type: Optional[str] = None,
|
|
108
|
+
) -> bool:
|
|
109
|
+
"""
|
|
110
|
+
Determines if a revision matches the specified repository ID and type.
|
|
111
|
+
|
|
112
|
+
:param repo: The repository information.
|
|
113
|
+
:type repo: CachedRepoInfo
|
|
114
|
+
:param revision: The revision information.
|
|
115
|
+
:type revision: CachedRevisionInfo
|
|
116
|
+
:param repo_id: The repository ID to match. If None, matches any ID.
|
|
117
|
+
:type repo_id: Optional[str]
|
|
118
|
+
:param repo_type: The repository type to match. If None, matches any type.
|
|
119
|
+
:type repo_type: Optional[str]
|
|
120
|
+
:return: True if the revision matches the repository conditions, False otherwise.
|
|
121
|
+
:rtype: bool
|
|
122
|
+
"""
|
|
123
|
+
_ = repo, revision
|
|
124
|
+
return _is_repo_match(repo, repo_id, repo_type)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def delete_cache(
|
|
128
|
+
repo_id: Optional[str] = None, repo_type: Optional[str] = None,
|
|
129
|
+
cache_dir: Optional[str] = None
|
|
130
|
+
):
|
|
131
|
+
"""
|
|
132
|
+
Deletes all revisions from the cache that match the specified repository ID and type.
|
|
133
|
+
|
|
134
|
+
:param repo_id: The repository ID to match. If None, matches any ID.
|
|
135
|
+
:type repo_id: Optional[str]
|
|
136
|
+
:param repo_type: The repository type to match. If None, matches any type.
|
|
137
|
+
:type repo_type: Optional[str]
|
|
138
|
+
:param cache_dir: The directory where the cache is stored. If None, uses the default directory.
|
|
139
|
+
:type cache_dir: Optional[str]
|
|
140
|
+
"""
|
|
141
|
+
# noinspection PyTypeChecker
|
|
142
|
+
strategy = _collect_revisions(
|
|
143
|
+
fn=partial(
|
|
144
|
+
_is_selected_revision,
|
|
145
|
+
repo_id=repo_id,
|
|
146
|
+
repo_type=repo_type,
|
|
147
|
+
),
|
|
148
|
+
cache_dir=cache_dir,
|
|
149
|
+
)
|
|
150
|
+
logging.info(f'{strategy.expected_freed_size_str} space will be freed.')
|
|
151
|
+
strategy.execute()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
from .fetch import hf_tar_list_files, hf_tar_file_download, hf_tar_get_index, hf_tar_file_exists, \
|
|
2
|
-
ArchiveStandaloneFileIncompleteDownload, ArchiveStandaloneFileHashNotMatch
|
|
2
|
+
ArchiveStandaloneFileIncompleteDownload, ArchiveStandaloneFileHashNotMatch, hf_tar_file_size, hf_tar_file_info
|
|
3
3
|
from .make import tar_create_index, hf_tar_create_index, tar_get_index_info, hf_tar_create_from_directory
|
|
4
4
|
from .validate import hf_tar_item_validate, hf_tar_validate
|
|
@@ -49,6 +49,36 @@ def hf_tar_get_index(repo_id: str, archive_in_repo: str,
|
|
|
49
49
|
:type hf_token: str, optional
|
|
50
50
|
:return: The index of the tar archive file.
|
|
51
51
|
:rtype: Dict
|
|
52
|
+
|
|
53
|
+
Examples::
|
|
54
|
+
>>> from hfutils.index import hf_tar_get_index
|
|
55
|
+
>>>
|
|
56
|
+
>>> idx = hf_tar_get_index(
|
|
57
|
+
... repo_id='deepghs/danbooru_newest',
|
|
58
|
+
... archive_in_repo='images/0000.tar',
|
|
59
|
+
... )
|
|
60
|
+
>>> idx.keys()
|
|
61
|
+
dict_keys(['filesize', 'hash', 'hash_lfs', 'files'])
|
|
62
|
+
>>> idx['files'].keys()
|
|
63
|
+
dict_keys(['7507000.jpg', '7506000.jpg', '7505000.jpg', ...])
|
|
64
|
+
|
|
65
|
+
.. note::
|
|
66
|
+
|
|
67
|
+
Besides, if the tar and index files are in different repositories, you can also use this function to
|
|
68
|
+
get the index information by explicitly assigning the ``idx_repo_id`` argument.
|
|
69
|
+
|
|
70
|
+
>>> from hfutils.index import hf_tar_get_index
|
|
71
|
+
>>>
|
|
72
|
+
>>> idx = hf_tar_get_index(
|
|
73
|
+
... repo_id='nyanko7/danbooru2023',
|
|
74
|
+
... idx_repo_id='deepghs/danbooru2023_index',
|
|
75
|
+
... archive_in_repo='original/data-0000.tar',
|
|
76
|
+
... )
|
|
77
|
+
>>> idx.keys()
|
|
78
|
+
dict_keys(['filesize', 'hash', 'hash_lfs', 'files'])
|
|
79
|
+
>>> idx['files'].keys()
|
|
80
|
+
dict_keys(['./1000.png', './10000.jpg', './100000.jpg', ...])
|
|
81
|
+
|
|
52
82
|
"""
|
|
53
83
|
hf_client = get_hf_client(hf_token)
|
|
54
84
|
body, _ = os.path.splitext(archive_in_repo)
|
|
@@ -90,6 +120,30 @@ def hf_tar_list_files(repo_id: str, archive_in_repo: str,
|
|
|
90
120
|
:type hf_token: str, optional
|
|
91
121
|
:return: The list of files inside the tar archive.
|
|
92
122
|
:rtype: List[str]
|
|
123
|
+
|
|
124
|
+
Examples::
|
|
125
|
+
>>> from hfutils.index import hf_tar_list_files
|
|
126
|
+
>>>
|
|
127
|
+
>>> hf_tar_list_files(
|
|
128
|
+
... repo_id='deepghs/danbooru_newest',
|
|
129
|
+
... archive_in_repo='images/0000.tar',
|
|
130
|
+
... )
|
|
131
|
+
['7507000.jpg', '7506000.jpg', '7505000.jpg', ...]
|
|
132
|
+
|
|
133
|
+
.. note::
|
|
134
|
+
|
|
135
|
+
Besides, if the tar and index files are in different repositories, you can also use this function to
|
|
136
|
+
list all the files by explicitly assigning the ``idx_repo_id`` argument.
|
|
137
|
+
|
|
138
|
+
>>> from hfutils.index import hf_tar_list_files
|
|
139
|
+
>>>
|
|
140
|
+
>>> hf_tar_list_files(
|
|
141
|
+
... repo_id='nyanko7/danbooru2023',
|
|
142
|
+
... idx_repo_id='deepghs/danbooru2023_index',
|
|
143
|
+
... archive_in_repo='original/data-0000.tar',
|
|
144
|
+
... )
|
|
145
|
+
['./1000.png', './10000.jpg', './100000.jpg', ...]
|
|
146
|
+
|
|
93
147
|
"""
|
|
94
148
|
index_data = hf_tar_get_index(
|
|
95
149
|
repo_id=repo_id,
|
|
@@ -138,6 +192,45 @@ def hf_tar_file_exists(repo_id: str, archive_in_repo: str, file_in_archive: str,
|
|
|
138
192
|
:type hf_token: str, optional
|
|
139
193
|
:return: True if the file exists, False otherwise.
|
|
140
194
|
:rtype: bool
|
|
195
|
+
|
|
196
|
+
Examples::
|
|
197
|
+
>>> from hfutils.index import hf_tar_file_exists
|
|
198
|
+
>>>
|
|
199
|
+
>>> hf_tar_file_exists(
|
|
200
|
+
... repo_id='deepghs/danbooru_newest',
|
|
201
|
+
... archive_in_repo='images/0000.tar',
|
|
202
|
+
... file_in_archive='7506000.jpg',
|
|
203
|
+
... )
|
|
204
|
+
True
|
|
205
|
+
>>> hf_tar_file_exists(
|
|
206
|
+
... repo_id='deepghs/danbooru_newest',
|
|
207
|
+
... archive_in_repo='images/0000.tar',
|
|
208
|
+
... file_in_archive='17506000.jpg',
|
|
209
|
+
... )
|
|
210
|
+
False
|
|
211
|
+
|
|
212
|
+
.. note::
|
|
213
|
+
|
|
214
|
+
Besides, if the tar and index files are in different repositories, you can also use this function to
|
|
215
|
+
check the file existence by explicitly assigning the ``idx_repo_id`` argument.
|
|
216
|
+
|
|
217
|
+
>>> from hfutils.index import hf_tar_file_exists
|
|
218
|
+
>>>
|
|
219
|
+
>>> hf_tar_file_exists(
|
|
220
|
+
... repo_id='nyanko7/danbooru2023',
|
|
221
|
+
... idx_repo_id='deepghs/danbooru2023_index',
|
|
222
|
+
... archive_in_repo='original/data-0000.tar',
|
|
223
|
+
... file_in_archive='1000.png'
|
|
224
|
+
... )
|
|
225
|
+
True
|
|
226
|
+
>>> hf_tar_file_exists(
|
|
227
|
+
... repo_id='nyanko7/danbooru2023',
|
|
228
|
+
... idx_repo_id='deepghs/danbooru2023_index',
|
|
229
|
+
... archive_in_repo='original/data-0000.tar',
|
|
230
|
+
... file_in_archive='10000000001000.png'
|
|
231
|
+
... )
|
|
232
|
+
False
|
|
233
|
+
|
|
141
234
|
"""
|
|
142
235
|
index = hf_tar_get_index(
|
|
143
236
|
repo_id=repo_id,
|
|
@@ -180,6 +273,155 @@ def _hf_files_process(files: Dict[str, dict]):
|
|
|
180
273
|
return {_n_path(key): value for key, value in files.items()}
|
|
181
274
|
|
|
182
275
|
|
|
276
|
+
def hf_tar_file_info(repo_id: str, archive_in_repo: str, file_in_archive: str,
|
|
277
|
+
repo_type: RepoTypeTyping = 'dataset', revision: str = 'main',
|
|
278
|
+
idx_repo_id: Optional[str] = None, idx_file_in_repo: Optional[str] = None,
|
|
279
|
+
idx_repo_type: Optional[RepoTypeTyping] = None, idx_revision: Optional[str] = None,
|
|
280
|
+
hf_token: Optional[str] = None) -> dict:
|
|
281
|
+
"""
|
|
282
|
+
Get a file's detailed information in index tars, including offset, sha256 and size.
|
|
283
|
+
|
|
284
|
+
:param repo_id: The identifier of the repository.
|
|
285
|
+
:type repo_id: str
|
|
286
|
+
:param archive_in_repo: The path to the archive file in the repository.
|
|
287
|
+
:type archive_in_repo: str
|
|
288
|
+
:param file_in_archive: The path to the file inside the archive.
|
|
289
|
+
:type file_in_archive: str
|
|
290
|
+
:param repo_type: The type of the Hugging Face repository.
|
|
291
|
+
:type repo_type: RepoTypeTyping, optional
|
|
292
|
+
:param revision: The revision of the repository.
|
|
293
|
+
:type revision: str, optional
|
|
294
|
+
:param idx_repo_id: The identifier of the index repository.
|
|
295
|
+
:type idx_repo_id: str, optional
|
|
296
|
+
:param idx_file_in_repo: The path to the index file in the index repository.
|
|
297
|
+
:type idx_file_in_repo: str, optional
|
|
298
|
+
:param idx_repo_type: The type of the index repository.
|
|
299
|
+
:type idx_repo_type: RepoTypeTyping, optional
|
|
300
|
+
:param idx_revision: The revision of the index repository.
|
|
301
|
+
:type idx_revision: str, optional
|
|
302
|
+
:param hf_token: The Hugging Face access token.
|
|
303
|
+
:type hf_token: str, optional
|
|
304
|
+
:return: Return a dictionary object with meta information of this file.
|
|
305
|
+
:rtype: dict
|
|
306
|
+
:raises FileNotFoundError: Raise this when file not exist in tar archive.
|
|
307
|
+
|
|
308
|
+
Examples::
|
|
309
|
+
>>> from hfutils.index import hf_tar_file_info
|
|
310
|
+
>>>
|
|
311
|
+
>>> hf_tar_file_info(
|
|
312
|
+
... repo_id='deepghs/danbooru_newest',
|
|
313
|
+
... archive_in_repo='images/0000.tar',
|
|
314
|
+
... file_in_archive='7506000.jpg',
|
|
315
|
+
... )
|
|
316
|
+
{'offset': 265728, 'size': 435671, 'sha256': 'ef6a4e031fdffb705c8ce2c64e8cb8d993f431a887d7c1c0b1e6fa56e6107fcd'}
|
|
317
|
+
|
|
318
|
+
.. note::
|
|
319
|
+
|
|
320
|
+
Besides, if the tar and index files are in different repositories, you can also use this function to
|
|
321
|
+
get the file information by explicitly assigning the ``idx_repo_id`` argument.
|
|
322
|
+
|
|
323
|
+
>>> from hfutils.index import hf_tar_file_info
|
|
324
|
+
>>>
|
|
325
|
+
>>> hf_tar_file_info(
|
|
326
|
+
... repo_id='nyanko7/danbooru2023',
|
|
327
|
+
... idx_repo_id='deepghs/danbooru2023_index',
|
|
328
|
+
... archive_in_repo='original/data-0000.tar',
|
|
329
|
+
... file_in_archive='1000.png'
|
|
330
|
+
... )
|
|
331
|
+
{'offset': 1024, 'size': 11966, 'sha256': '478d3313860519372f6a75ede287d4a7c18a2d851bbc79b3dd65caff4c716858'}
|
|
332
|
+
"""
|
|
333
|
+
index = hf_tar_get_index(
|
|
334
|
+
repo_id=repo_id,
|
|
335
|
+
archive_in_repo=archive_in_repo,
|
|
336
|
+
repo_type=repo_type,
|
|
337
|
+
revision=revision,
|
|
338
|
+
|
|
339
|
+
idx_repo_id=idx_repo_id,
|
|
340
|
+
idx_file_in_repo=idx_file_in_repo,
|
|
341
|
+
idx_repo_type=idx_repo_type,
|
|
342
|
+
idx_revision=idx_revision,
|
|
343
|
+
|
|
344
|
+
hf_token=hf_token,
|
|
345
|
+
)
|
|
346
|
+
files = _hf_files_process(index['files'])
|
|
347
|
+
if _n_path(file_in_archive) not in files:
|
|
348
|
+
raise FileNotFoundError(f'File {file_in_archive!r} not found '
|
|
349
|
+
f'in {repo_type}s/{repo_id}@{revision}/{archive_in_repo}.')
|
|
350
|
+
else:
|
|
351
|
+
return files[_n_path(file_in_archive)]
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
def hf_tar_file_size(repo_id: str, archive_in_repo: str, file_in_archive: str,
|
|
355
|
+
repo_type: RepoTypeTyping = 'dataset', revision: str = 'main',
|
|
356
|
+
idx_repo_id: Optional[str] = None, idx_file_in_repo: Optional[str] = None,
|
|
357
|
+
idx_repo_type: Optional[RepoTypeTyping] = None, idx_revision: Optional[str] = None,
|
|
358
|
+
hf_token: Optional[str] = None) -> int:
|
|
359
|
+
"""
|
|
360
|
+
Get a file's size in index tars.
|
|
361
|
+
|
|
362
|
+
:param repo_id: The identifier of the repository.
|
|
363
|
+
:type repo_id: str
|
|
364
|
+
:param archive_in_repo: The path to the archive file in the repository.
|
|
365
|
+
:type archive_in_repo: str
|
|
366
|
+
:param file_in_archive: The path to the file inside the archive.
|
|
367
|
+
:type file_in_archive: str
|
|
368
|
+
:param repo_type: The type of the Hugging Face repository.
|
|
369
|
+
:type repo_type: RepoTypeTyping, optional
|
|
370
|
+
:param revision: The revision of the repository.
|
|
371
|
+
:type revision: str, optional
|
|
372
|
+
:param idx_repo_id: The identifier of the index repository.
|
|
373
|
+
:type idx_repo_id: str, optional
|
|
374
|
+
:param idx_file_in_repo: The path to the index file in the index repository.
|
|
375
|
+
:type idx_file_in_repo: str, optional
|
|
376
|
+
:param idx_repo_type: The type of the index repository.
|
|
377
|
+
:type idx_repo_type: RepoTypeTyping, optional
|
|
378
|
+
:param idx_revision: The revision of the index repository.
|
|
379
|
+
:type idx_revision: str, optional
|
|
380
|
+
:param hf_token: The Hugging Face access token.
|
|
381
|
+
:type hf_token: str, optional
|
|
382
|
+
:return: Return an integer which represents the size of this file.
|
|
383
|
+
:rtype: int
|
|
384
|
+
:raises FileNotFoundError: Raise this when file not exist in tar archive.
|
|
385
|
+
|
|
386
|
+
Examples::
|
|
387
|
+
>>> from hfutils.index import hf_tar_file_size
|
|
388
|
+
>>>
|
|
389
|
+
>>> hf_tar_file_size(
|
|
390
|
+
... repo_id='deepghs/danbooru_newest',
|
|
391
|
+
... archive_in_repo='images/0000.tar',
|
|
392
|
+
... file_in_archive='7506000.jpg',
|
|
393
|
+
... )
|
|
394
|
+
435671
|
|
395
|
+
|
|
396
|
+
.. note::
|
|
397
|
+
|
|
398
|
+
Besides, if the tar and index files are in different repositories, you can also use this function to
|
|
399
|
+
get the file size by explicitly assigning the ``idx_repo_id`` argument.
|
|
400
|
+
|
|
401
|
+
>>> from hfutils.index import hf_tar_file_size
|
|
402
|
+
>>>
|
|
403
|
+
>>> hf_tar_file_size(
|
|
404
|
+
... repo_id='nyanko7/danbooru2023',
|
|
405
|
+
... idx_repo_id='deepghs/danbooru2023_index',
|
|
406
|
+
... archive_in_repo='original/data-0000.tar',
|
|
407
|
+
... file_in_archive='1000.png'
|
|
408
|
+
... )
|
|
409
|
+
11966
|
|
410
|
+
"""
|
|
411
|
+
return hf_tar_file_info(
|
|
412
|
+
repo_id=repo_id,
|
|
413
|
+
archive_in_repo=archive_in_repo,
|
|
414
|
+
file_in_archive=file_in_archive,
|
|
415
|
+
repo_type=repo_type,
|
|
416
|
+
revision=revision,
|
|
417
|
+
idx_repo_id=idx_repo_id,
|
|
418
|
+
idx_file_in_repo=idx_file_in_repo,
|
|
419
|
+
idx_repo_type=idx_repo_type,
|
|
420
|
+
idx_revision=idx_revision,
|
|
421
|
+
hf_token=hf_token
|
|
422
|
+
)['size']
|
|
423
|
+
|
|
424
|
+
|
|
183
425
|
def hf_tar_file_download(repo_id: str, archive_in_repo: str, file_in_archive: str, local_file: str,
|
|
184
426
|
repo_type: RepoTypeTyping = 'dataset', revision: str = 'main',
|
|
185
427
|
idx_repo_id: Optional[str] = None, idx_file_in_repo: Optional[str] = None,
|
|
@@ -220,6 +462,34 @@ def hf_tar_file_download(repo_id: str, archive_in_repo: str, file_in_archive: st
|
|
|
220
462
|
:type endpoint: str, optional
|
|
221
463
|
:param hf_token: The Hugging Face access token.
|
|
222
464
|
:type hf_token: str, optional
|
|
465
|
+
:raises FileNotFoundError: Raise this when file not exist in tar archive.
|
|
466
|
+
:raises ArchiveStandaloneFileIncompleteDownload: Raise when download incomplete.
|
|
467
|
+
:raises ArchiveStandaloneFileHashNotMatch: Raise when download hash not match.
|
|
468
|
+
|
|
469
|
+
Examples::
|
|
470
|
+
>>> from hfutils.index import hf_tar_file_download
|
|
471
|
+
>>>
|
|
472
|
+
>>> hf_tar_file_download(
|
|
473
|
+
... repo_id='deepghs/danbooru_newest',
|
|
474
|
+
... archive_in_repo='images/0000.tar',
|
|
475
|
+
... file_in_archive='7506000.jpg',
|
|
476
|
+
... local_file='test_example.jpg' # download destination
|
|
477
|
+
... )
|
|
478
|
+
|
|
479
|
+
.. note::
|
|
480
|
+
|
|
481
|
+
Besides, if the tar and index files are in different repositories, you can also use this function to
|
|
482
|
+
download the given file by explicitly assigning the ``idx_repo_id`` argument.
|
|
483
|
+
|
|
484
|
+
>>> from hfutils.index import hf_tar_file_download
|
|
485
|
+
>>>
|
|
486
|
+
>>> hf_tar_file_download(
|
|
487
|
+
... repo_id='nyanko7/danbooru2023',
|
|
488
|
+
... idx_repo_id='deepghs/danbooru2023_index',
|
|
489
|
+
... archive_in_repo='original/data-0000.tar',
|
|
490
|
+
... file_in_archive='1000.png',
|
|
491
|
+
... local_file='test_example.png' # download destination
|
|
492
|
+
... )
|
|
223
493
|
"""
|
|
224
494
|
index = hf_tar_get_index(
|
|
225
495
|
repo_id=repo_id,
|
|
@@ -16,6 +16,9 @@ def tar_get_index_info(src_tar_file, chunk_for_hash: int = 1 << 20, with_hash: b
|
|
|
16
16
|
"""
|
|
17
17
|
Get the index information of a tar archive file.
|
|
18
18
|
|
|
19
|
+
.. note::
|
|
20
|
+
The return value of this function will be directly used as the index json file.
|
|
21
|
+
|
|
19
22
|
:param src_tar_file: The path to the source tar archive file.
|
|
20
23
|
:type src_tar_file: str
|
|
21
24
|
:param chunk_for_hash: The chunk size for hashing, defaults to 1 << 20 (1 MB).
|
|
@@ -48,6 +48,9 @@ def hf_tar_validate(repo_id: str, archive_in_repo: str, repo_type: RepoTypeTypin
|
|
|
48
48
|
|
|
49
49
|
This function validates if the tar archive in the Hugging Face repository matches the expected size and hash.
|
|
50
50
|
|
|
51
|
+
.. note::
|
|
52
|
+
This function is based on Huggingface API and hash information in index files, no tar file will be downloaded.
|
|
53
|
+
|
|
51
54
|
:param repo_id: The ID of the Hugging Face repository.
|
|
52
55
|
:type repo_id: str
|
|
53
56
|
:param archive_in_repo: The path to the tar archive in the repository.
|
|
@@ -70,6 +73,13 @@ def hf_tar_validate(repo_id: str, archive_in_repo: str, repo_type: RepoTypeTypin
|
|
|
70
73
|
:raises IsADirectoryError: If the specified entry is a directory.
|
|
71
74
|
:return: True if the tar archive is valid, False otherwise.
|
|
72
75
|
:rtype: bool
|
|
76
|
+
|
|
77
|
+
.. note::
|
|
78
|
+
|
|
79
|
+
If this function returns `False`, it means the json index is expired and need to be re-generated.
|
|
80
|
+
|
|
81
|
+
So this function and :func:`hfutils.index.make.hf_tar_create_index` can be used together to gracefully
|
|
82
|
+
refresh an indexed tar dataset.
|
|
73
83
|
"""
|
|
74
84
|
hf_client = get_hf_client(hf_token)
|
|
75
85
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hfutils
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
4
4
|
Summary: Useful utilities for huggingface
|
|
5
5
|
Home-page: https://github.com/deepghs/hfutils
|
|
6
6
|
Author: narugo1992
|
|
@@ -20,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
20
20
|
Requires-Python: >=3.8
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: hbutils>=0.9.
|
|
23
|
+
Requires-Dist: hbutils>=0.9.3
|
|
24
24
|
Requires-Dist: huggingface_hub>=0.23
|
|
25
25
|
Requires-Dist: tqdm
|
|
26
26
|
Requires-Dist: requests
|
|
@@ -30,6 +30,8 @@ Requires-Dist: natsort
|
|
|
30
30
|
Provides-Extra: build
|
|
31
31
|
Requires-Dist: pyinstaller<5,>=4.7; extra == "build"
|
|
32
32
|
Requires-Dist: setuptools<70; extra == "build"
|
|
33
|
+
Provides-Extra: transfer
|
|
34
|
+
Requires-Dist: hf-transfer; extra == "transfer"
|
|
33
35
|
Provides-Extra: doc
|
|
34
36
|
Requires-Dist: Jinja2>=3.0.0; extra == "doc"
|
|
35
37
|
Requires-Dist: sphinx>=3.2.0; extra == "doc"
|
|
@@ -50,10 +52,8 @@ Requires-Dist: ipykernel>=6.15; extra == "doc"
|
|
|
50
52
|
Requires-Dist: py-cpuinfo>=8.0.0; extra == "doc"
|
|
51
53
|
Requires-Dist: click>=7.0.0; extra == "doc"
|
|
52
54
|
Requires-Dist: pandas; extra == "doc"
|
|
53
|
-
Provides-Extra:
|
|
54
|
-
Requires-Dist:
|
|
55
|
-
Provides-Extra: transfer
|
|
56
|
-
Requires-Dist: hf-transfer; extra == "transfer"
|
|
55
|
+
Provides-Extra: rar
|
|
56
|
+
Requires-Dist: rarfile; extra == "rar"
|
|
57
57
|
Provides-Extra: test
|
|
58
58
|
Requires-Dist: coverage>=5; extra == "test"
|
|
59
59
|
Requires-Dist: mock>=4.0.3; extra == "test"
|
|
@@ -71,8 +71,8 @@ Requires-Dist: testtools>=2; extra == "test"
|
|
|
71
71
|
Requires-Dist: where>=1.0.2; extra == "test"
|
|
72
72
|
Requires-Dist: responses>=0.20.0; extra == "test"
|
|
73
73
|
Requires-Dist: natsort; extra == "test"
|
|
74
|
-
Provides-Extra:
|
|
75
|
-
Requires-Dist:
|
|
74
|
+
Provides-Extra: 7z
|
|
75
|
+
Requires-Dist: py7zr; extra == "7z"
|
|
76
76
|
|
|
77
77
|
# hfutils
|
|
78
78
|
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"datasets": [
|
|
3
|
-
"ade_corpus_v2",
|
|
4
|
-
"afrikaans_ner_corpus",
|
|
5
|
-
"app_reviews",
|
|
6
|
-
"arabic_billion_words",
|
|
7
|
-
"arabic_speech_corpus",
|
|
8
|
-
"arxiv_dataset",
|
|
9
|
-
"aslg_pc12",
|
|
10
|
-
"autshumato",
|
|
11
|
-
"banking77",
|
|
12
|
-
"bigbench",
|
|
13
|
-
"billsum",
|
|
14
|
-
"blended_skill_talk",
|
|
15
|
-
"bnl_newspapers",
|
|
16
|
-
"bookcorpus",
|
|
17
|
-
"bswac",
|
|
18
|
-
"c3",
|
|
19
|
-
"c4",
|
|
20
|
-
"cail2018",
|
|
21
|
-
"caner",
|
|
22
|
-
"catalonia_independence",
|
|
23
|
-
"cawac",
|
|
24
|
-
"cbt",
|
|
25
|
-
"cc100",
|
|
26
|
-
"cdsc",
|
|
27
|
-
"cifar10",
|
|
28
|
-
"cifar100",
|
|
29
|
-
"clickbait_news_bg",
|
|
30
|
-
"clinc_oos",
|
|
31
|
-
"clue",
|
|
32
|
-
"cmu_hinglish_dog",
|
|
33
|
-
"code_search_net",
|
|
34
|
-
"conceptnet5",
|
|
35
|
-
"conll2012_ontonotesv5",
|
|
36
|
-
"consumer-finance-complaints",
|
|
37
|
-
"conv_ai",
|
|
38
|
-
"conv_ai_2",
|
|
39
|
-
"conv_ai_3",
|
|
40
|
-
"cornell_movie_dialog",
|
|
41
|
-
"cos_e",
|
|
42
|
-
"covid_qa_ucsd",
|
|
43
|
-
"covid_tweets_japanese",
|
|
44
|
-
"covost2",
|
|
45
|
-
"cppe-5",
|
|
46
|
-
"crime_and_punish",
|
|
47
|
-
"cs_restaurants",
|
|
48
|
-
"daily_dialog",
|
|
49
|
-
"danish_political_comments",
|
|
50
|
-
"definite_pronoun_resolution",
|
|
51
|
-
"dialog_re",
|
|
52
|
-
"diplomacy_detection",
|
|
53
|
-
"disaster_response_messages",
|
|
54
|
-
"discofuse",
|
|
55
|
-
"doqa",
|
|
56
|
-
"dream",
|
|
57
|
-
"dutch_social",
|
|
58
|
-
"dyk",
|
|
59
|
-
"ehealth_kd",
|
|
60
|
-
"elkarhizketak",
|
|
61
|
-
"emo",
|
|
62
|
-
"emotone_ar",
|
|
63
|
-
"enwik8",
|
|
64
|
-
"esnli",
|
|
65
|
-
"ett",
|
|
66
|
-
"eu_regulatory_ir",
|
|
67
|
-
"eurlex",
|
|
68
|
-
"euronews",
|
|
69
|
-
"europa_eac_tm",
|
|
70
|
-
"europa_ecdc_tm",
|
|
71
|
-
"factckbr",
|
|
72
|
-
"fake_news_english",
|
|
73
|
-
"farsi_news",
|
|
74
|
-
"fashion_mnist",
|
|
75
|
-
"food101",
|
|
76
|
-
"generics_kb",
|
|
77
|
-
"germaner",
|
|
78
|
-
"germeval_14",
|
|
79
|
-
"glucose",
|
|
80
|
-
"gnad10",
|
|
81
|
-
"go_emotions",
|
|
82
|
-
"grail_qa",
|
|
83
|
-
"gsm8k",
|
|
84
|
-
"gutenberg_time",
|
|
85
|
-
"hansards",
|
|
86
|
-
"harem",
|
|
87
|
-
"has_part",
|
|
88
|
-
"hate_speech_filipino",
|
|
89
|
-
"hate_speech_pl",
|
|
90
|
-
"hate_speech_portuguese",
|
|
91
|
-
"hebrew_projectbenyehuda",
|
|
92
|
-
"hebrew_sentiment",
|
|
93
|
-
"hebrew_this_world",
|
|
94
|
-
"hope_edi",
|
|
95
|
-
"hotpot_qa",
|
|
96
|
-
"hover",
|
|
97
|
-
"hrenwac_para",
|
|
98
|
-
"hrwac",
|
|
99
|
-
"humicroedit",
|
|
100
|
-
"hyperpartisan_news_detection",
|
|
101
|
-
"id_clickbait",
|
|
102
|
-
"id_nergrit_corpus",
|
|
103
|
-
"id_newspapers_2018",
|
|
104
|
-
"ilist",
|
|
105
|
-
"imagenet-1k",
|
|
106
|
-
"imppres",
|
|
107
|
-
"indic_glue",
|
|
108
|
-
"isixhosa_ner_corpus",
|
|
109
|
-
"isizulu_ner_corpus",
|
|
110
|
-
"jeopardy",
|
|
111
|
-
"jnlpba",
|
|
112
|
-
"journalists_questions",
|
|
113
|
-
"kilt_tasks",
|
|
114
|
-
"klue",
|
|
115
|
-
"kor_ner",
|
|
116
|
-
"kor_sarcasm",
|
|
117
|
-
"librispeech_asr",
|
|
118
|
-
"lince",
|
|
119
|
-
"liveqa",
|
|
120
|
-
"lm1b",
|
|
121
|
-
"makhzan",
|
|
122
|
-
"matinf",
|
|
123
|
-
"mbpp",
|
|
124
|
-
"mc4",
|
|
125
|
-
"med_hop",
|
|
126
|
-
"medical_questions_pairs",
|
|
127
|
-
"movie_rationales",
|
|
128
|
-
"mrqa",
|
|
129
|
-
"ms_marco",
|
|
130
|
-
"muchocine",
|
|
131
|
-
"narrativeqa",
|
|
132
|
-
"nchlt",
|
|
133
|
-
"ncslgr",
|
|
134
|
-
"nell",
|
|
135
|
-
"newsqa",
|
|
136
|
-
"nkjp-ner",
|
|
137
|
-
"nq_open",
|
|
138
|
-
"oclar",
|
|
139
|
-
"offenseval_dravidian",
|
|
140
|
-
"ohsumed",
|
|
141
|
-
"onestop_english",
|
|
142
|
-
"openai_humaneval",
|
|
143
|
-
"para_crawl",
|
|
144
|
-
"para_pat",
|
|
145
|
-
"parsinlu_reading_comprehension",
|
|
146
|
-
"paws",
|
|
147
|
-
"paws-x",
|
|
148
|
-
"peoples_daily_ner",
|
|
149
|
-
"per_sent",
|
|
150
|
-
"proto_qa",
|
|
151
|
-
"psc",
|
|
152
|
-
"ptb_text_only",
|
|
153
|
-
"qa4mre",
|
|
154
|
-
"qa_zre",
|
|
155
|
-
"qangaroo",
|
|
156
|
-
"qanta",
|
|
157
|
-
"quail",
|
|
158
|
-
"quarel",
|
|
159
|
-
"quickdraw",
|
|
160
|
-
"quora",
|
|
161
|
-
"re_dial",
|
|
162
|
-
"reclor",
|
|
163
|
-
"reddit_tifu",
|
|
164
|
-
"roman_urdu",
|
|
165
|
-
"roman_urdu_hate_speech",
|
|
166
|
-
"ronec",
|
|
167
|
-
"rotten_tomatoes",
|
|
168
|
-
"scan",
|
|
169
|
-
"scielo",
|
|
170
|
-
"sede",
|
|
171
|
-
"selqa",
|
|
172
|
-
"sem_eval_2010_task_8",
|
|
173
|
-
"sem_eval_2014_task_1",
|
|
174
|
-
"sem_eval_2018_task_1",
|
|
175
|
-
"sem_eval_2020_task_11",
|
|
176
|
-
"sent_comp",
|
|
177
|
-
"senti_lex",
|
|
178
|
-
"senti_ws",
|
|
179
|
-
"sepedi_ner",
|
|
180
|
-
"sesotho_ner_corpus",
|
|
181
|
-
"setimes",
|
|
182
|
-
"setswana_ner_corpus",
|
|
183
|
-
"siswati_ner_corpus",
|
|
184
|
-
"snips_built_in_intents",
|
|
185
|
-
"snow_simplified_japanese_corpus",
|
|
186
|
-
"so_stacksample",
|
|
187
|
-
"sofc_materials_articles",
|
|
188
|
-
"sogou_news",
|
|
189
|
-
"squad_kor_v1",
|
|
190
|
-
"squad_kor_v2",
|
|
191
|
-
"srwac",
|
|
192
|
-
"story_cloze",
|
|
193
|
-
"style_change_detection",
|
|
194
|
-
"svhn",
|
|
195
|
-
"swahili",
|
|
196
|
-
"swahili_news",
|
|
197
|
-
"swedish_medical_ner",
|
|
198
|
-
"tamilmixsentiment",
|
|
199
|
-
"tapaco",
|
|
200
|
-
"tashkeela",
|
|
201
|
-
"telugu_books",
|
|
202
|
-
"telugu_news",
|
|
203
|
-
"thai_toxicity_tweet",
|
|
204
|
-
"times_of_india_news_headlines",
|
|
205
|
-
"timit_asr",
|
|
206
|
-
"tmu_gfm_dataset",
|
|
207
|
-
"truthful_qa",
|
|
208
|
-
"turk",
|
|
209
|
-
"turkic_xwmt",
|
|
210
|
-
"turkish_shrinked_ner",
|
|
211
|
-
"tweet_eval",
|
|
212
|
-
"tweet_qa",
|
|
213
|
-
"tweets_ar_en_parallel",
|
|
214
|
-
"tweets_hate_speech_detection",
|
|
215
|
-
"ubuntu_dialogs_corpus",
|
|
216
|
-
"udhr",
|
|
217
|
-
"um005",
|
|
218
|
-
"universal_dependencies",
|
|
219
|
-
"universal_morphologies",
|
|
220
|
-
"urdu_fake_news",
|
|
221
|
-
"urdu_sentiment_corpus",
|
|
222
|
-
"vctk",
|
|
223
|
-
"vivos",
|
|
224
|
-
"web_nlg",
|
|
225
|
-
"web_of_science",
|
|
226
|
-
"web_questions",
|
|
227
|
-
"wi_locness",
|
|
228
|
-
"wiki40b",
|
|
229
|
-
"wiki_hop",
|
|
230
|
-
"wiki_lingua",
|
|
231
|
-
"wiki_qa",
|
|
232
|
-
"wiki_snippets",
|
|
233
|
-
"wikipedia",
|
|
234
|
-
"wikitext",
|
|
235
|
-
"wikitext_tl39",
|
|
236
|
-
"wongnai_reviews",
|
|
237
|
-
"xnli",
|
|
238
|
-
"xquad_r",
|
|
239
|
-
"yahoo_answers_qa",
|
|
240
|
-
"yahoo_answers_topics",
|
|
241
|
-
"yelp_review_full",
|
|
242
|
-
"yoruba_bbc_topics",
|
|
243
|
-
"youtube_caption_corrections"
|
|
244
|
-
],
|
|
245
|
-
"models": [],
|
|
246
|
-
"spaces": []
|
|
247
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|