16 lines
1.1 KiB
Python
16 lines
1.1 KiB
Python
import hashlib,json,urllib.request
|
|
from pathlib import Path
|
|
root=Path(__file__).resolve().parent.parent
|
|
base=json.loads((root/'huobao-data/last-launch.json').read_text())['api']
|
|
def request(path,body=None,method=None):
|
|
req=urllib.request.Request(base+path,data=json.dumps(body).encode() if body else None,headers={'Content-Type':'application/json'},method=method)
|
|
with urllib.request.urlopen(req,timeout=20) as response:return json.load(response)['data']
|
|
configs=request('/ai-configs')
|
|
row=next(c for c in configs if c['id']==6 and 'qwen_image_2_1' in c['model'])
|
|
protected={k:row.get(k) for k in ('base_url','api_key','model','provider','priority','is_active')}
|
|
request('/ai-configs/6',{'name':'Qwen Image 2.1(默认图片·双卡自动调度)'},'PUT')
|
|
after=next(c for c in request('/ai-configs') if c['id']==6)
|
|
assert protected=={k:after.get(k) for k in protected}
|
|
(root/'integration-work/image-config-verification.json').write_text(json.dumps({'config_id':6,'protected_fields_unchanged':True,'name':after['name']},ensure_ascii=False,indent=2))
|
|
print('Image config 6 now labels dual-GPU auto scheduling; credentials, model and priority unchanged')
|