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.
@@ -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
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>=0.20.0
33
- Requires-Dist: datasets>=2.16.0
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
@@ -8,7 +8,7 @@ AtomGit CLI - 基于Transformers和Hugging Face Hub的模型文件上传下载
8
8
  支持模型和数据集的上传、下载等操作。
9
9
  """
10
10
 
11
- __version__ = '1.0.3'
11
+ __version__ = '1.0.5'
12
12
  __author__ = 'AtomGit CLI Team'
13
13
  __description__ = 'AtomGit模型文件上传下载CLI工具'
14
14
 
@@ -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
- # 使用AtomGit Hub SDK上传整个目录
153
+ # 使用 Monkey Patch 方式临时修改 huggingface_hub 的默认超时配置
157
154
  commit_message = message or "Upload folder using atomgit client"
158
- atomgit_upload_folder(
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
- # 直接使用AtomGit Hub SDK上传目录
188
+ # 使用 Monkey Patch 方式临时修改 huggingface_hub 的默认超时配置
190
189
  commit_message = message or "Upload folder using atomgit client"
191
- atomgit_upload_folder(
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
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>=0.20.0
33
- Requires-Dist: datasets>=2.16.0
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
@@ -1,3 +1,4 @@
1
+ MANIFEST.in
1
2
  README.md
2
3
  __init__.py
3
4
  __main__.py
@@ -5,6 +6,7 @@ api.py
5
6
  atomgit_hub.py
6
7
  cli.py
7
8
  config.py
9
+ requirements.txt
8
10
  setup.py
9
11
  test.py
10
12
  utils.py
@@ -3,5 +3,5 @@ requests>=2.31.0
3
3
  tqdm>=4.66.1
4
4
  colorama>=0.4.6
5
5
  tabulate>=0.9.0
6
- huggingface-hub>=0.20.0
7
- datasets>=2.16.0
6
+ huggingface-hub==1.1.7
7
+ datasets==4.4.1
@@ -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.3')
42
+ @click.version_option(version='1.0.5')
41
43
  def cli():
42
44
  """AtomGit CLI - 基于Transformers和Hugging Face Hub的AtomGit平台模型文件上传下载工具"""
43
45
  pass
@@ -0,0 +1,7 @@
1
+ click>=8.1.7
2
+ requests>=2.31.0
3
+ tqdm>=4.66.1
4
+ colorama>=0.4.6
5
+ tabulate>=0.9.0
6
+ huggingface-hub==1.1.7
7
+ datasets==4.4.1
@@ -31,7 +31,7 @@ def read_requirements():
31
31
 
32
32
  setup(
33
33
  name='atomgit',
34
- version='1.0.3',
34
+ version='1.0.5',
35
35
  author='AtomGit CLI Team',
36
36
  author_email='sa@atomgit.com',
37
37
  description='AtomGit模型文件上传下载CLI工具',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes