Cion-lab commited on
Commit
edbcee6
·
verified ·
1 Parent(s): f6d90c6

publish_model.py: drop max_workers (not in the Kaggle image's Hub client)

Browse files
Files changed (1) hide show
  1. build/publish_model.py +4 -1
build/publish_model.py CHANGED
@@ -325,8 +325,11 @@ def main():
325
  if todo:
326
  for i in range(0, len(todo), 120): # one commit per 120 files: E-033's rate ceiling
327
  b = todo[i:i + 120]
 
 
 
328
  api.upload_folder(repo_id=a.repo, folder_path=src, path_in_repo="",
329
- allow_patterns=b, max_workers=2, repo_type="model",
330
  commit_message=f"publish weights: batch {i // 120 + 1} of {len(b)} file(s)")
331
  back = set(api.list_repo_files(repo_id=a.repo, repo_type="model"))
332
  missing = sorted({f for f, _ in up} - back)
 
325
  if todo:
326
  for i in range(0, len(todo), 120): # one commit per 120 files: E-033's rate ceiling
327
  b = todo[i:i + 120]
328
+ # `max_workers` is accepted by the Hub client on this workspace but not in the Kaggle image,
329
+ # where it raised TypeError and killed the first publish attempt (E-007's class: an API that
330
+ # exists locally and not in the job). Default concurrency is fine for a 7-file repo.
331
  api.upload_folder(repo_id=a.repo, folder_path=src, path_in_repo="",
332
+ allow_patterns=b, repo_type="model",
333
  commit_message=f"publish weights: batch {i // 120 + 1} of {len(b)} file(s)")
334
  back = set(api.list_repo_files(repo_id=a.repo, repo_type="model"))
335
  missing = sorted({f for f, _ in up} - back)