forked from luopingyi/xc_agent_platform_demo
live: EXTERNAL_SERVICE_TOKEN precedence, baked A/B candidates, model|gpu ledger from task/page modelId+gpuType, string total fix, Iluvatar/MTT enums (59 tests)
This commit is contained in:
23
scripts/bake_candidates.py
Normal file
23
scripts/bake_candidates.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""Bake the local pending pool without network access."""
|
||||
import json
|
||||
import sys
|
||||
from collections import Counter
|
||||
from pathlib import Path
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
||||
from src.pending_pool import build_ordered_candidates
|
||||
from src.banned import banned_rule
|
||||
|
||||
|
||||
def main():
|
||||
rows = build_ordered_candidates('/workspace/modelhub-adapt/pending-submit.md', '/workspace/modelhub-adapt/pending-submit.txt')
|
||||
print('input', dict(Counter(r['section'] for r in rows)))
|
||||
rows = [dict(model_address=r['model_address'], section=r['section'], foothold_class=r['foothold_class'], try_next_gpus=r['try_next_gpus'], framework='vllm') for r in rows if not r['skip_reason'] and not banned_rule(r['model_address'])]
|
||||
rows.sort(key=lambda r: (r['section'] != 'A', r['foothold_class'] != 'verified_reuse'))
|
||||
output = Path(__file__).resolve().parents[1] / 'src/data/candidates.json'
|
||||
output.parent.mkdir(exist_ok=True)
|
||||
output.write_text(json.dumps(rows, ensure_ascii=False, indent=2) + '\n')
|
||||
print('baked', dict(Counter(r['section'] for r in rows)), 'total', len(rows))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user