atomgit 1.0.3__tar.gz → 1.0.5__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.
- atomgit-1.0.5/MANIFEST.in +1 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/PKG-INFO +3 -3
- {atomgit-1.0.3 → atomgit-1.0.5}/__init__.py +1 -1
- {atomgit-1.0.3 → atomgit-1.0.5}/api.py +12 -12
- {atomgit-1.0.3 → atomgit-1.0.5}/atomgit.egg-info/PKG-INFO +3 -3
- {atomgit-1.0.3 → atomgit-1.0.5}/atomgit.egg-info/SOURCES.txt +2 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/atomgit.egg-info/requires.txt +2 -2
- {atomgit-1.0.3 → atomgit-1.0.5}/atomgit_hub.py +2 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/cli.py +3 -1
- atomgit-1.0.5/requirements.txt +7 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/setup.py +1 -1
- {atomgit-1.0.3 → atomgit-1.0.5}/README.md +0 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/__main__.py +0 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/atomgit.egg-info/dependency_links.txt +0 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/atomgit.egg-info/entry_points.txt +0 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/atomgit.egg-info/top_level.txt +0 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/config.py +0 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/setup.cfg +0 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/test.py +0 -0
- {atomgit-1.0.3 → atomgit-1.0.5}/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include requirements.txt
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: atomgit
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.5
|
|
4
4
|
Summary: AtomGit模型文件上传下载CLI工具
|
|
5
5
|
Home-page: https://atomgit.com/gitcode-ai/atomgit_cli
|
|
6
6
|
Author: AtomGit CLI Team
|
|
@@ -29,8 +29,8 @@ Requires-Dist: requests>=2.31.0
|
|
|
29
29
|
Requires-Dist: tqdm>=4.66.1
|
|
30
30
|
Requires-Dist: colorama>=0.4.6
|
|
31
31
|
Requires-Dist: tabulate>=0.9.0
|
|
32
|
-
Requires-Dist: huggingface-hub
|
|
33
|
-
Requires-Dist: datasets
|
|
32
|
+
Requires-Dist: huggingface-hub==1.1.7
|
|
33
|
+
Requires-Dist: datasets==4.4.1
|
|
34
34
|
Dynamic: author
|
|
35
35
|
Dynamic: author-email
|
|
36
36
|
Dynamic: classifier
|
|
@@ -7,18 +7,15 @@ import urllib.error
|
|
|
7
7
|
|
|
8
8
|
# 设置Hugging Face Hub的API端点为AtomGit
|
|
9
9
|
os.environ["HF_ENDPOINT"] = "https://hub.atomgit.com"
|
|
10
|
+
# 禁用Xet协议,避免 xet-write-token 请求
|
|
11
|
+
os.environ["HF_HUB_DISABLE_XET"] = "1"
|
|
10
12
|
# 设置缓存目录
|
|
11
13
|
cache_dir = os.path.expanduser("~/.cache/atomgit")
|
|
12
14
|
os.makedirs(cache_dir, exist_ok=True)
|
|
13
15
|
os.environ["HF_HOME"] = cache_dir
|
|
14
16
|
|
|
15
17
|
|
|
16
|
-
from huggingface_hub import hf_hub_download, create_repo, snapshot_download
|
|
17
|
-
|
|
18
|
-
try:
|
|
19
|
-
from .atomgit_hub import upload_folder as atomgit_upload_folder
|
|
20
|
-
except ImportError:
|
|
21
|
-
from atomgit_hub import upload_folder as atomgit_upload_folder
|
|
18
|
+
from huggingface_hub import hf_hub_download, upload_folder, create_repo, snapshot_download, constants as hf_constants
|
|
22
19
|
|
|
23
20
|
try:
|
|
24
21
|
from .config import config
|
|
@@ -153,15 +150,17 @@ class HuggingFaceAPI:
|
|
|
153
150
|
# 复制文件到临时目录
|
|
154
151
|
import shutil
|
|
155
152
|
shutil.copy2(file_path, target_file)
|
|
156
|
-
# 使用
|
|
153
|
+
# 使用 Monkey Patch 方式临时修改 huggingface_hub 的默认超时配置
|
|
157
154
|
commit_message = message or "Upload folder using atomgit client"
|
|
158
|
-
|
|
155
|
+
hf_constants.DEFAULT_REQUEST_TIMEOUT = upload_timeout
|
|
156
|
+
upload_kwargs = dict(
|
|
159
157
|
repo_id=repo_id,
|
|
160
158
|
folder_path=str(temp_dir),
|
|
161
159
|
token=credentials['token'],
|
|
162
160
|
commit_message=commit_message,
|
|
163
|
-
upload_timeout=upload_timeout
|
|
164
161
|
)
|
|
162
|
+
upload_folder(**upload_kwargs)
|
|
163
|
+
|
|
165
164
|
return True
|
|
166
165
|
finally:
|
|
167
166
|
# 清理临时目录
|
|
@@ -186,15 +185,16 @@ class HuggingFaceAPI:
|
|
|
186
185
|
print("未找到登录凭证")
|
|
187
186
|
return False
|
|
188
187
|
|
|
189
|
-
#
|
|
188
|
+
# 使用 Monkey Patch 方式临时修改 huggingface_hub 的默认超时配置
|
|
190
189
|
commit_message = message or "Upload folder using atomgit client"
|
|
191
|
-
|
|
190
|
+
hf_constants.DEFAULT_REQUEST_TIMEOUT = upload_timeout
|
|
191
|
+
upload_kwargs = dict(
|
|
192
192
|
repo_id=repo_id,
|
|
193
193
|
folder_path=str(dir_path),
|
|
194
194
|
token=credentials['token'],
|
|
195
195
|
commit_message=commit_message,
|
|
196
|
-
upload_timeout=upload_timeout
|
|
197
196
|
)
|
|
197
|
+
upload_folder(**upload_kwargs)
|
|
198
198
|
|
|
199
199
|
return True
|
|
200
200
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: atomgit
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.5
|
|
4
4
|
Summary: AtomGit模型文件上传下载CLI工具
|
|
5
5
|
Home-page: https://atomgit.com/gitcode-ai/atomgit_cli
|
|
6
6
|
Author: AtomGit CLI Team
|
|
@@ -29,8 +29,8 @@ Requires-Dist: requests>=2.31.0
|
|
|
29
29
|
Requires-Dist: tqdm>=4.66.1
|
|
30
30
|
Requires-Dist: colorama>=0.4.6
|
|
31
31
|
Requires-Dist: tabulate>=0.9.0
|
|
32
|
-
Requires-Dist: huggingface-hub
|
|
33
|
-
Requires-Dist: datasets
|
|
32
|
+
Requires-Dist: huggingface-hub==1.1.7
|
|
33
|
+
Requires-Dist: datasets==4.4.1
|
|
34
34
|
Dynamic: author
|
|
35
35
|
Dynamic: author-email
|
|
36
36
|
Dynamic: classifier
|
|
@@ -14,6 +14,8 @@ from pathlib import Path
|
|
|
14
14
|
|
|
15
15
|
# 设置Hugging Face Hub的API端点为AtomGit
|
|
16
16
|
os.environ["HF_ENDPOINT"] = "https://hub.atomgit.com"
|
|
17
|
+
# 禁用Xet协议,避免 xet-write-token 请求
|
|
18
|
+
os.environ["HF_HUB_DISABLE_XET"] = "1"
|
|
17
19
|
# 设置缓存目录
|
|
18
20
|
cache_dir = os.path.expanduser("~/.cache/atomgit")
|
|
19
21
|
os.makedirs(cache_dir, exist_ok=True)
|
|
@@ -9,6 +9,8 @@ from getpass import getpass
|
|
|
9
9
|
|
|
10
10
|
# 设置Hugging Face Hub的API端点为AtomGit
|
|
11
11
|
os.environ["HF_ENDPOINT"] = "https://hub.atomgit.com"
|
|
12
|
+
# 禁用Xet协议,避免 xet-write-token 请求
|
|
13
|
+
os.environ["HF_HUB_DISABLE_XET"] = "1"
|
|
12
14
|
# 设置缓存目录
|
|
13
15
|
cache_dir = os.path.expanduser("~/.cache/atomgit")
|
|
14
16
|
os.makedirs(cache_dir, exist_ok=True)
|
|
@@ -37,7 +39,7 @@ except ImportError:
|
|
|
37
39
|
|
|
38
40
|
|
|
39
41
|
@click.group()
|
|
40
|
-
@click.version_option(version='1.0.
|
|
42
|
+
@click.version_option(version='1.0.5')
|
|
41
43
|
def cli():
|
|
42
44
|
"""AtomGit CLI - 基于Transformers和Hugging Face Hub的AtomGit平台模型文件上传下载工具"""
|
|
43
45
|
pass
|
|
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
|