atomgit 1.0.3__tar.gz → 1.0.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atomgit
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: AtomGit模型文件上传下载CLI工具
5
5
  Home-page: https://atomgit.com/gitcode-ai/atomgit_cli
6
6
  Author: AtomGit CLI Team
@@ -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.4'
12
12
  __author__ = 'AtomGit CLI Team'
13
13
  __description__ = 'AtomGit模型文件上传下载CLI工具'
14
14
 
@@ -13,12 +13,7 @@ os.makedirs(cache_dir, exist_ok=True)
13
13
  os.environ["HF_HOME"] = cache_dir
14
14
 
15
15
 
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
16
+ from huggingface_hub import hf_hub_download, upload_folder, create_repo, snapshot_download, constants as hf_constants
22
17
 
23
18
  try:
24
19
  from .config import config
@@ -153,15 +148,16 @@ class HuggingFaceAPI:
153
148
  # 复制文件到临时目录
154
149
  import shutil
155
150
  shutil.copy2(file_path, target_file)
156
- # 使用AtomGit Hub SDK上传整个目录
151
+ # 使用 Monkey Patch 方式临时修改 huggingface_hub 的默认超时配置
157
152
  commit_message = message or "Upload folder using atomgit client"
158
- atomgit_upload_folder(
153
+ hf_constants.DEFAULT_REQUEST_TIMEOUT = upload_timeout
154
+ upload_folder(
159
155
  repo_id=repo_id,
160
156
  folder_path=str(temp_dir),
161
157
  token=credentials['token'],
162
- commit_message=commit_message,
163
- upload_timeout=upload_timeout
158
+ commit_message=commit_message
164
159
  )
160
+
165
161
  return True
166
162
  finally:
167
163
  # 清理临时目录
@@ -186,14 +182,14 @@ class HuggingFaceAPI:
186
182
  print("未找到登录凭证")
187
183
  return False
188
184
 
189
- # 直接使用AtomGit Hub SDK上传目录
185
+ # 使用 Monkey Patch 方式临时修改 huggingface_hub 的默认超时配置
190
186
  commit_message = message or "Upload folder using atomgit client"
191
- atomgit_upload_folder(
187
+ hf_constants.DEFAULT_REQUEST_TIMEOUT = upload_timeout
188
+ upload_folder(
192
189
  repo_id=repo_id,
193
190
  folder_path=str(dir_path),
194
191
  token=credentials['token'],
195
- commit_message=commit_message,
196
- upload_timeout=upload_timeout
192
+ commit_message=commit_message
197
193
  )
198
194
 
199
195
  return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atomgit
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: AtomGit模型文件上传下载CLI工具
5
5
  Home-page: https://atomgit.com/gitcode-ai/atomgit_cli
6
6
  Author: AtomGit CLI Team
@@ -37,7 +37,7 @@ except ImportError:
37
37
 
38
38
 
39
39
  @click.group()
40
- @click.version_option(version='1.0.3')
40
+ @click.version_option(version='1.0.4')
41
41
  def cli():
42
42
  """AtomGit CLI - 基于Transformers和Hugging Face Hub的AtomGit平台模型文件上传下载工具"""
43
43
  pass
@@ -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.4',
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
File without changes