HuggingFace0920 commited on
Commit
c5c4b27
·
verified ·
1 Parent(s): 24d8083

Upload sync_data.sh

Browse files
Files changed (1) hide show
  1. sync_data.sh +2 -2
sync_data.sh CHANGED
@@ -76,7 +76,7 @@ def download_latest_backup(token, repo_id, extract_path):
76
  def super_squash_history(token, repo_id, keep_latest=3):
77
  try:
78
  api = HfApi(token=token)
79
- api.super_squash_history(repo_id=repo_id, repo_type="dataset", keep_last_commits=keep_latest)
80
  print(f"历史合并完成,仅保留最近 {keep_latest} 次提交。")
81
  except Exception as e:
82
  print(f"合并历史出错: {str(e)}")
@@ -123,7 +123,7 @@ sync_data() {
123
  # 定期合并历史提交,只保留最新的3个提交
124
  echo "正在合并历史提交,仅保留最近3次提交..."
125
  python hf_sync.py super_squash "${HF_TOKEN}" "${DATASET_ID}" 3
126
-
127
  # 清理临时文件
128
  rm -f "/tmp/${backup_file}"
129
  else
 
76
  def super_squash_history(token, repo_id, keep_latest=3):
77
  try:
78
  api = HfApi(token=token)
79
+ api.super_squash_history(repo_id=repo_id, repo_type="dataset", keep_last=keep_latest)
80
  print(f"历史合并完成,仅保留最近 {keep_latest} 次提交。")
81
  except Exception as e:
82
  print(f"合并历史出错: {str(e)}")
 
123
  # 定期合并历史提交,只保留最新的3个提交
124
  echo "正在合并历史提交,仅保留最近3次提交..."
125
  python hf_sync.py super_squash "${HF_TOKEN}" "${DATASET_ID}" 3
126
+
127
  # 清理临时文件
128
  rm -f "/tmp/${backup_file}"
129
  else