hfutils 0.3.5__tar.gz → 0.3.6__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.3.5/hfutils.egg-info → hfutils-0.3.6}/PKG-INFO +23 -23
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/config/meta.py +1 -1
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/index/fetch.py +17 -7
- {hfutils-0.3.5 → hfutils-0.3.6/hfutils.egg-info}/PKG-INFO +23 -23
- {hfutils-0.3.5 → hfutils-0.3.6}/LICENSE +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/MANIFEST.in +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/README.md +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/__init__.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/__main__.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/archive/__init__.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/archive/base.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/archive/rar.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/archive/sevenz.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/archive/tar.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/archive/zip.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/cache/__init__.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/cache/delete.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/config/__init__.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/__init__.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/base.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/cli.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/clone.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/dispatch.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/download.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/index.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/ls.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/ls_repo.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/rollback.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/upload.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/entry/whoami.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/index/__init__.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/index/hash.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/index/local_fetch.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/index/make.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/index/validate.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/operate/__init__.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/operate/base.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/operate/download.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/operate/upload.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/operate/validate.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/repository/__init__.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/repository/base.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/repository/clone.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/repository/rollback.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/utils/__init__.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/utils/binary.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/utils/download.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/utils/irregular_repo.json +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/utils/logging.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/utils/number.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/utils/path.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/utils/temp.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/utils/tqdm_.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils/utils/walk.py +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils.egg-info/SOURCES.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils.egg-info/dependency_links.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils.egg-info/entry_points.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils.egg-info/requires.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/hfutils.egg-info/top_level.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/requirements-7z.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/requirements-build.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/requirements-doc.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/requirements-rar.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/requirements-test.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/requirements-transfer.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/requirements.txt +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/setup.cfg +0 -0
- {hfutils-0.3.5 → hfutils-0.3.6}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hfutils
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.6
|
|
4
4
|
Summary: Useful utilities for huggingface
|
|
5
5
|
Home-page: https://github.com/deepghs/hfutils
|
|
6
6
|
Author: narugo1992
|
|
@@ -29,28 +29,6 @@ Requires-Dist: tzlocal
|
|
|
29
29
|
Requires-Dist: natsort
|
|
30
30
|
Requires-Dist: urlobject
|
|
31
31
|
Requires-Dist: fsspec>=2024
|
|
32
|
-
Provides-Extra: test
|
|
33
|
-
Requires-Dist: coverage>=5; extra == "test"
|
|
34
|
-
Requires-Dist: mock>=4.0.3; extra == "test"
|
|
35
|
-
Requires-Dist: flake8~=3.5; extra == "test"
|
|
36
|
-
Requires-Dist: testfixtures>=6.18.5; extra == "test"
|
|
37
|
-
Requires-Dist: pytest~=6.2.5; extra == "test"
|
|
38
|
-
Requires-Dist: pytest-cov~=3.0.0; extra == "test"
|
|
39
|
-
Requires-Dist: pytest-mock~=3.6.1; extra == "test"
|
|
40
|
-
Requires-Dist: pytest-xdist>=1.34.0; extra == "test"
|
|
41
|
-
Requires-Dist: pytest-rerunfailures~=10.2; extra == "test"
|
|
42
|
-
Requires-Dist: pytest-timeout~=2.0.2; extra == "test"
|
|
43
|
-
Requires-Dist: pytest-benchmark~=3.4.0; extra == "test"
|
|
44
|
-
Requires-Dist: easydict<2,>=1.7; extra == "test"
|
|
45
|
-
Requires-Dist: testtools>=2; extra == "test"
|
|
46
|
-
Requires-Dist: where>=1.0.2; extra == "test"
|
|
47
|
-
Requires-Dist: responses>=0.20.0; extra == "test"
|
|
48
|
-
Requires-Dist: natsort; extra == "test"
|
|
49
|
-
Provides-Extra: 7z
|
|
50
|
-
Requires-Dist: py7zr; extra == "7z"
|
|
51
|
-
Provides-Extra: build
|
|
52
|
-
Requires-Dist: pyinstaller<5,>=4.7; extra == "build"
|
|
53
|
-
Requires-Dist: setuptools<70; extra == "build"
|
|
54
32
|
Provides-Extra: doc
|
|
55
33
|
Requires-Dist: Jinja2>=3.0.0; extra == "doc"
|
|
56
34
|
Requires-Dist: sphinx>=3.2.0; extra == "doc"
|
|
@@ -71,8 +49,30 @@ Requires-Dist: ipykernel>=6.15; extra == "doc"
|
|
|
71
49
|
Requires-Dist: py-cpuinfo>=8.0.0; extra == "doc"
|
|
72
50
|
Requires-Dist: click>=7.0.0; extra == "doc"
|
|
73
51
|
Requires-Dist: pandas; extra == "doc"
|
|
52
|
+
Provides-Extra: test
|
|
53
|
+
Requires-Dist: coverage>=5; extra == "test"
|
|
54
|
+
Requires-Dist: mock>=4.0.3; extra == "test"
|
|
55
|
+
Requires-Dist: flake8~=3.5; extra == "test"
|
|
56
|
+
Requires-Dist: testfixtures>=6.18.5; extra == "test"
|
|
57
|
+
Requires-Dist: pytest~=6.2.5; extra == "test"
|
|
58
|
+
Requires-Dist: pytest-cov~=3.0.0; extra == "test"
|
|
59
|
+
Requires-Dist: pytest-mock~=3.6.1; extra == "test"
|
|
60
|
+
Requires-Dist: pytest-xdist>=1.34.0; extra == "test"
|
|
61
|
+
Requires-Dist: pytest-rerunfailures~=10.2; extra == "test"
|
|
62
|
+
Requires-Dist: pytest-timeout~=2.0.2; extra == "test"
|
|
63
|
+
Requires-Dist: pytest-benchmark~=3.4.0; extra == "test"
|
|
64
|
+
Requires-Dist: easydict<2,>=1.7; extra == "test"
|
|
65
|
+
Requires-Dist: testtools>=2; extra == "test"
|
|
66
|
+
Requires-Dist: where>=1.0.2; extra == "test"
|
|
67
|
+
Requires-Dist: responses>=0.20.0; extra == "test"
|
|
68
|
+
Requires-Dist: natsort; extra == "test"
|
|
74
69
|
Provides-Extra: transfer
|
|
75
70
|
Requires-Dist: hf-transfer; extra == "transfer"
|
|
71
|
+
Provides-Extra: 7z
|
|
72
|
+
Requires-Dist: py7zr; extra == "7z"
|
|
73
|
+
Provides-Extra: build
|
|
74
|
+
Requires-Dist: pyinstaller<5,>=4.7; extra == "build"
|
|
75
|
+
Requires-Dist: setuptools<70; extra == "build"
|
|
76
76
|
Provides-Extra: rar
|
|
77
77
|
Requires-Dist: rarfile; extra == "rar"
|
|
78
78
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import os.path
|
|
3
|
+
import threading
|
|
4
|
+
from collections import defaultdict
|
|
3
5
|
from typing import Optional, Dict, Union, List
|
|
4
6
|
|
|
5
7
|
from huggingface_hub.file_download import http_get, hf_hub_url
|
|
@@ -21,6 +23,9 @@ class ArchiveStandaloneFileHashNotMatch(Exception):
|
|
|
21
23
|
"""
|
|
22
24
|
|
|
23
25
|
|
|
26
|
+
_HF_TAR_IDX_LOCKS = defaultdict(threading.Lock)
|
|
27
|
+
|
|
28
|
+
|
|
24
29
|
def hf_tar_get_index(repo_id: str, archive_in_repo: str,
|
|
25
30
|
repo_type: RepoTypeTyping = 'dataset', revision: str = 'main',
|
|
26
31
|
idx_repo_id: Optional[str] = None, idx_file_in_repo: Optional[str] = None,
|
|
@@ -83,13 +88,18 @@ def hf_tar_get_index(repo_id: str, archive_in_repo: str,
|
|
|
83
88
|
hf_client = get_hf_client(hf_token)
|
|
84
89
|
body, _ = os.path.splitext(archive_in_repo)
|
|
85
90
|
default_index_file = f'{body}.json'
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
f_repo_id = idx_repo_id or repo_id
|
|
92
|
+
f_repo_type = idx_repo_type or repo_type
|
|
93
|
+
f_filename = idx_file_in_repo or default_index_file
|
|
94
|
+
f_revision = idx_revision or revision
|
|
95
|
+
with _HF_TAR_IDX_LOCKS[(f_repo_id, f_repo_type, f_filename, f_revision)]:
|
|
96
|
+
with open(hf_client.hf_hub_download(
|
|
97
|
+
repo_id=f_repo_id,
|
|
98
|
+
repo_type=f_repo_type,
|
|
99
|
+
filename=f_filename,
|
|
100
|
+
revision=f_revision,
|
|
101
|
+
), 'r') as f:
|
|
102
|
+
return json.load(f)
|
|
93
103
|
|
|
94
104
|
|
|
95
105
|
def hf_tar_list_files(repo_id: str, archive_in_repo: str,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hfutils
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.6
|
|
4
4
|
Summary: Useful utilities for huggingface
|
|
5
5
|
Home-page: https://github.com/deepghs/hfutils
|
|
6
6
|
Author: narugo1992
|
|
@@ -29,28 +29,6 @@ Requires-Dist: tzlocal
|
|
|
29
29
|
Requires-Dist: natsort
|
|
30
30
|
Requires-Dist: urlobject
|
|
31
31
|
Requires-Dist: fsspec>=2024
|
|
32
|
-
Provides-Extra: test
|
|
33
|
-
Requires-Dist: coverage>=5; extra == "test"
|
|
34
|
-
Requires-Dist: mock>=4.0.3; extra == "test"
|
|
35
|
-
Requires-Dist: flake8~=3.5; extra == "test"
|
|
36
|
-
Requires-Dist: testfixtures>=6.18.5; extra == "test"
|
|
37
|
-
Requires-Dist: pytest~=6.2.5; extra == "test"
|
|
38
|
-
Requires-Dist: pytest-cov~=3.0.0; extra == "test"
|
|
39
|
-
Requires-Dist: pytest-mock~=3.6.1; extra == "test"
|
|
40
|
-
Requires-Dist: pytest-xdist>=1.34.0; extra == "test"
|
|
41
|
-
Requires-Dist: pytest-rerunfailures~=10.2; extra == "test"
|
|
42
|
-
Requires-Dist: pytest-timeout~=2.0.2; extra == "test"
|
|
43
|
-
Requires-Dist: pytest-benchmark~=3.4.0; extra == "test"
|
|
44
|
-
Requires-Dist: easydict<2,>=1.7; extra == "test"
|
|
45
|
-
Requires-Dist: testtools>=2; extra == "test"
|
|
46
|
-
Requires-Dist: where>=1.0.2; extra == "test"
|
|
47
|
-
Requires-Dist: responses>=0.20.0; extra == "test"
|
|
48
|
-
Requires-Dist: natsort; extra == "test"
|
|
49
|
-
Provides-Extra: 7z
|
|
50
|
-
Requires-Dist: py7zr; extra == "7z"
|
|
51
|
-
Provides-Extra: build
|
|
52
|
-
Requires-Dist: pyinstaller<5,>=4.7; extra == "build"
|
|
53
|
-
Requires-Dist: setuptools<70; extra == "build"
|
|
54
32
|
Provides-Extra: doc
|
|
55
33
|
Requires-Dist: Jinja2>=3.0.0; extra == "doc"
|
|
56
34
|
Requires-Dist: sphinx>=3.2.0; extra == "doc"
|
|
@@ -71,8 +49,30 @@ Requires-Dist: ipykernel>=6.15; extra == "doc"
|
|
|
71
49
|
Requires-Dist: py-cpuinfo>=8.0.0; extra == "doc"
|
|
72
50
|
Requires-Dist: click>=7.0.0; extra == "doc"
|
|
73
51
|
Requires-Dist: pandas; extra == "doc"
|
|
52
|
+
Provides-Extra: test
|
|
53
|
+
Requires-Dist: coverage>=5; extra == "test"
|
|
54
|
+
Requires-Dist: mock>=4.0.3; extra == "test"
|
|
55
|
+
Requires-Dist: flake8~=3.5; extra == "test"
|
|
56
|
+
Requires-Dist: testfixtures>=6.18.5; extra == "test"
|
|
57
|
+
Requires-Dist: pytest~=6.2.5; extra == "test"
|
|
58
|
+
Requires-Dist: pytest-cov~=3.0.0; extra == "test"
|
|
59
|
+
Requires-Dist: pytest-mock~=3.6.1; extra == "test"
|
|
60
|
+
Requires-Dist: pytest-xdist>=1.34.0; extra == "test"
|
|
61
|
+
Requires-Dist: pytest-rerunfailures~=10.2; extra == "test"
|
|
62
|
+
Requires-Dist: pytest-timeout~=2.0.2; extra == "test"
|
|
63
|
+
Requires-Dist: pytest-benchmark~=3.4.0; extra == "test"
|
|
64
|
+
Requires-Dist: easydict<2,>=1.7; extra == "test"
|
|
65
|
+
Requires-Dist: testtools>=2; extra == "test"
|
|
66
|
+
Requires-Dist: where>=1.0.2; extra == "test"
|
|
67
|
+
Requires-Dist: responses>=0.20.0; extra == "test"
|
|
68
|
+
Requires-Dist: natsort; extra == "test"
|
|
74
69
|
Provides-Extra: transfer
|
|
75
70
|
Requires-Dist: hf-transfer; extra == "transfer"
|
|
71
|
+
Provides-Extra: 7z
|
|
72
|
+
Requires-Dist: py7zr; extra == "7z"
|
|
73
|
+
Provides-Extra: build
|
|
74
|
+
Requires-Dist: pyinstaller<5,>=4.7; extra == "build"
|
|
75
|
+
Requires-Dist: setuptools<70; extra == "build"
|
|
76
76
|
Provides-Extra: rar
|
|
77
77
|
Requires-Dist: rarfile; extra == "rar"
|
|
78
78
|
|
|
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
|
|
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
|