37 lines
3.0 KiB
Plaintext
37 lines
3.0 KiB
Plaintext
from pathlib import Path
|
|
import re
|
|
R=Path.cwd();S=R/'docs/hel-892/wantalk-document-evidence';D=R/'docs/hel-892/singleloop-document-evidence'
|
|
old='Wan2.1_I2V_InfiniteTalk_提示词调度动作控制图生视频数字人(KJ版).json';new='Wan2.1_infinitetalk_音频驱动视频配音-单人for循环长视频(官流).json'
|
|
def change(t):
|
|
t=t.replace(old,new).replace('wantalk','singleloop').replace('f9658e918a2527a181cf3970f1e118bc1b2d98e3','bab653af6e019ef68ba01735c3f1277de9eaf342').replace('提示词调度动作控制数字人','单人循环官流数字人')
|
|
t=re.sub(r'\b(136|137|8233|8351|234|241|118)\b',lambda m:{'136':'137','137':'138','8233':'8351','8351':'8480','234':'241','241':'246','118':'129'}[m[0]],t)
|
|
t=t.replace('136块','137块').replace('137参考','138参考').replace('old_one_hundred_thirty_six','old_one_hundred_thirty_seven')
|
|
return t
|
|
for name in ['inventory.py','rebuild.py','repeat.py','recompute.py','freeze.py','source_closure.py','render_report.py','collect_browser.py','package_delivery.py','finalize.py']:
|
|
t=change((S/name).read_text())
|
|
t=t.replace('"new_notes": 7','"new_notes": 5').replace('== 7 and len(doc["source_notes"]) == 7','== 5 and len(doc["source_notes"]) == 5')
|
|
t=t.replace('七完整注释','五完整注释').replace('23准确类或发布成员实例、三具体未匹配','逐实例准确类与无版本别名缺口分列').replace('batch156','batch157')
|
|
if name=='finalize.py':
|
|
a=t.index(' for name in [');z=t.index(' b = doc["fixed_version"]',a)
|
|
t=t[:a]+''' for p in (REPO / ".local-evidence").glob("*singleloop*.py"):
|
|
shutil.copyfile(p, OUT / (p.name + ".txt"))
|
|
'''+t[z:]
|
|
(D/name).write_text(t)
|
|
for name in ['singleloop-document.mjs','singleloop-document-server.py','run-singleloop-document.py']:
|
|
original=name.replace('singleloop','wantalk');(R/'e2e'/name).write_text(change((R/'e2e'/original).read_text()))
|
|
p=R/'calliope-backend/tests/test_singleloop_fixed_document.py';t=change((p.with_name('test_wantalk_fixed_document.py')).read_text());t=t.replace('len(BLOCK["comments"]) == 7','len(BLOCK["comments"]) == 5').replace('len(BLOCK["zero_saved_nodes"]) == 1','len(BLOCK["zero_saved_nodes"]) == 8')
|
|
a=t.index('def test_exact_classes_and_concrete_protocol_gaps():');z=t.index('@pytest.mark.parametrize(',a)
|
|
t=t[:a]+'''def test_exact_classes_and_concrete_protocol_gaps():
|
|
assert len(BLOCK["node_bindings"]) == 90
|
|
unknown = [b for b in BLOCK["node_bindings"] if not b["implementation_verified"]]
|
|
assert all(b["class_type"] in ["SetNode", "GetNode"] for b in unknown)
|
|
assert all("named_pointer" not in f and "named_value" not in f for f in BLOCK["fields"])
|
|
assert len([f for f in BLOCK["fields"] if f["json_type"] == "NoneType"]) == 2
|
|
histories = [f for f in BLOCK["fields"] if f["field"] == "videopreview"]
|
|
assert len(histories) == 2 and all(f["value"]["params"]["score"] == "0" for f in histories)
|
|
assert {f["value"]["params"]["frame_rate"] for f in histories} == {16, 25}
|
|
|
|
|
|
'''+t[z:];p.write_text(t)
|
|
print('Prepared new standalone evidence/test/browser tooling only')
|