add DOWNLOAD_ONLY mode: run zhoushasha downloads without submitting any validation task
All 498 models in the current list already had their hygon and bi150 slots reserved in earlier rounds, so this round only needs the downloads. Without a switch the download list would be empty, since phase 2 only downloads models reserved in the same run. DOWNLOAD_ONLY skips the reservation phase entirely and downloads all of ALL_MODEL_IDS. Also splits the worker into _reserve_phase / _download_phase and gates bi150 behind ENABLE_BI150_SUBMIT for symmetry with hygon. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
89
main.py
89
main.py
@@ -41,11 +41,20 @@ HYGON_SUBMIT_ACCOUNT = "zhoukaile"
|
||||
HYGON_XC_TOKEN = "bd7c52f3b9604ef48a14dd6174513935"
|
||||
|
||||
# ── 本轮开关 ────────────────────────────────────────────────
|
||||
# 纯下载模式:当前 498 个模型的 hygon 和 bi150 都已经在前几轮提前占位完成,
|
||||
# 本轮只用 zhoushasha 跑下载任务,不再提交任何验证任务。
|
||||
# 开启后会【跳过整个占位阶段】,直接下载 ALL_MODEL_IDS 里的全部模型。
|
||||
# 换新模型列表时改回 False,并把下面两个 ENABLE_* 打开。
|
||||
DOWNLOAD_ONLY = True
|
||||
|
||||
# hygon 已经用 zhoukaile 把当前模型列表(498个)从头交到最后一个了,
|
||||
# 再交只会全部撞 60028,所以本轮关掉 hygon,只补 bi150,让两张卡覆盖对齐。
|
||||
# 下次换新模型列表时把它改回 True。
|
||||
# 再交只会全部撞 60028。下次换新模型列表时把它改回 True。
|
||||
ENABLE_HYGON_SUBMIT = False
|
||||
|
||||
# bi150 已由 34 个零积分小号 + zhangyuanxi 兜底占位完成(v2.2.0 补了 436 个)。
|
||||
# 下次换新模型列表时把它改回 True。
|
||||
ENABLE_BI150_SUBMIT = False
|
||||
|
||||
# bi150 兜底账号:零积分小号(每个只占1个)用完之后,
|
||||
# 剩余模型的 bi150 统一用这个账号提交。
|
||||
# 用独立账号而不是 zhoukaile,避免和 hygon 抢同一个账号的额度。
|
||||
@@ -2823,28 +2832,63 @@ def _run_worker():
|
||||
# 对策:把提交挪到下载【之前】。先占位再下载,下载队列即使被爬也没用。
|
||||
# 触发的 adminProxy 代下载很慢无所谓——我方自己的下载会先完成。
|
||||
# ══════════════════════════════════════════════════════
|
||||
_state["phase"] = "reserving"
|
||||
_init_bi150_queue()
|
||||
|
||||
reserved_models = [] # 占位成功、需要下载的模型(按占位顺序)
|
||||
|
||||
print(
|
||||
f"\n🔒 阶段一:占位(bi150 零积分待占位账号 {len(_bi150_pending)} 个,"
|
||||
f"用完后兜底账号={BI150_FALLBACK_ACCOUNT};"
|
||||
f"hygon={'启用' if ENABLE_HYGON_SUBMIT else '本轮关闭'})\n",
|
||||
flush=True,
|
||||
)
|
||||
if DOWNLOAD_ONLY:
|
||||
# 纯下载模式:占位已在前几轮完成,直接下载全部模型
|
||||
reserved_models = list(ALL_MODEL_IDS)
|
||||
print(
|
||||
f"\n⏭️ 纯下载模式(DOWNLOAD_ONLY=True):跳过占位阶段,"
|
||||
f"直接下载全部 {len(reserved_models)} 个模型,不提交任何验证任务\n",
|
||||
flush=True,
|
||||
)
|
||||
else:
|
||||
_state["phase"] = "reserving"
|
||||
_init_bi150_queue()
|
||||
print(
|
||||
f"\n🔒 阶段一:占位(bi150 零积分待占位账号 {len(_bi150_pending)} 个,"
|
||||
f"用完后兜底账号={BI150_FALLBACK_ACCOUNT},"
|
||||
f"bi150={'启用' if ENABLE_BI150_SUBMIT else '关闭'};"
|
||||
f"hygon={'启用' if ENABLE_HYGON_SUBMIT else '关闭'})\n",
|
||||
flush=True,
|
||||
)
|
||||
_reserve_phase(reserved_models)
|
||||
print(
|
||||
f"\n🔒 占位阶段完成:bi150={_state['reserved_bi150']} "
|
||||
f"hygon={_state['reserved_hygon']} "
|
||||
f"待下载模型={len(reserved_models)}\n",
|
||||
flush=True,
|
||||
)
|
||||
|
||||
# ══════════════════════════════════════════════════════
|
||||
# 阶段二:下载(机制A,zhoushasha,8 并发)
|
||||
# 只下载已占到位的模型——这些位置已经是我方的,下载完即可开跑验证
|
||||
# ══════════════════════════════════════════════════════
|
||||
_state["phase"] = "downloading"
|
||||
pending_models = list(reserved_models) # 尚未开始下载的模型
|
||||
active_models: Set[str] = set() # 当前正在下载的模型
|
||||
completed_results = {} # model_id -> status
|
||||
|
||||
print(f"🚀 阶段二:下载 {len(pending_models)} 个模型。最大并发数: {MAX_CONCURRENT_DOWNLOADS}\n", flush=True)
|
||||
|
||||
_download_phase(token, pending_models, active_models, completed_results)
|
||||
|
||||
|
||||
def _reserve_phase(reserved_models: List[str]) -> None:
|
||||
"""阶段一:占位(机制B)。结果追加到 reserved_models。"""
|
||||
for model_id in ALL_MODEL_IDS:
|
||||
if _shutdown.is_set():
|
||||
break
|
||||
if _bi150_quota_full and (_hygon_quota_full or not ENABLE_HYGON_SUBMIT):
|
||||
bi_done = _bi150_quota_full or not ENABLE_BI150_SUBMIT
|
||||
hy_done = _hygon_quota_full or not ENABLE_HYGON_SUBMIT
|
||||
if bi_done and hy_done:
|
||||
print("🔒 bi150 与 hygon 均已无额度可用,占位阶段结束", flush=True)
|
||||
break
|
||||
|
||||
got = False
|
||||
|
||||
# bi150:先用还没有 bi150 任务的零积分账号,用完后走兜底账号
|
||||
if not _bi150_quota_full:
|
||||
if ENABLE_BI150_SUBMIT and not _bi150_quota_full:
|
||||
if submit_test_task_bi150(model_id):
|
||||
_state["submitted"] += 1
|
||||
_state["reserved_bi150"] += 1
|
||||
@@ -2864,24 +2908,9 @@ def _run_worker():
|
||||
if got:
|
||||
reserved_models.append(model_id)
|
||||
|
||||
print(
|
||||
f"\n🔒 占位阶段完成:bi150={_state['reserved_bi150']} "
|
||||
f"hygon={_state['reserved_hygon']} "
|
||||
f"待下载模型={len(reserved_models)}\n",
|
||||
flush=True,
|
||||
)
|
||||
|
||||
# ══════════════════════════════════════════════════════
|
||||
# 阶段二:下载(机制A,zhoushasha,8 并发)
|
||||
# 只下载已经占到位的模型——这些位置已经是我方的,下载完即可开跑验证
|
||||
# ══════════════════════════════════════════════════════
|
||||
_state["phase"] = "downloading"
|
||||
pending_models = list(reserved_models) # 尚未开始下载的模型
|
||||
active_models: Set[str] = set() # 当前正在下载的模型
|
||||
completed_results = {} # model_id -> status
|
||||
|
||||
print(f"🚀 阶段二:下载 {len(pending_models)} 个已占位模型。最大并发数: {MAX_CONCURRENT_DOWNLOADS}\n", flush=True)
|
||||
|
||||
def _download_phase(token, pending_models, active_models, completed_results) -> None:
|
||||
"""阶段二:下载(机制A,zhoushasha)。"""
|
||||
while (pending_models or active_models) and not _shutdown.is_set():
|
||||
# 1. 检查活跃任务状态
|
||||
for model_id in list(active_models):
|
||||
|
||||
Reference in New Issue
Block a user