Files
dj/integration-work/check_h3_english_audio.py

18 lines
1.6 KiB
Python

"""Validate English visual directions with Chinese speech in memory; no generation."""
import subprocess
code='''import app,json
from workflow import load_registry,compile_workflow
prompt='Cast: @图片1乔雨灵. 0-3s: In heavy rain, @图片1乔雨灵 looks up and says in Mandarin Chinese: 「别开门!」 3-9s: The camera slowly moves toward the dark window. No subtitles.'
for key in ['minimax_h3_r2v','minimax_h3_r2v_4step','minimax_h3_hybrid_v0331_i2v','minimax_h3_vdn_hd']:
try:
spec=load_registry()[key];req=app.JobRequest(workflow_key=key,prompt=prompt,duration=9,width=1344,height=768)
plan=app.request_audio_plan(spec,req)
print(json.dumps({'workflow':key,**{k:plan.get(k) for k in ['supported','status','audio_mode','speech_requested','expected_transcript','normalized_prompt']}},ensure_ascii=False))
except KeyError:pass
for speech in ['@乔雨灵 says: "别开门!"','@乔雨灵 说:「别开门!」','Dialogue: "别开门!"','Dialogue: 「剧目《偷宿》。演员:高天明,乔雨灵。」','台词:别开门!','旁白:「别开门!」']:
plan=app.plan_h3_audio('0-3s: A woman stands in the rain. '+speech+' 3-9s: A dark window. No subtitles.',9)
if speech.startswith('Dialogue:'):assert plan.get('speech_requested'),plan
print(json.dumps({'speech':speech,**{k:plan.get(k) for k in ['speech_requested','audio_mode','expected_transcript','normalized_prompt']}},ensure_ascii=False))
'''
r=subprocess.run(['docker','exec','canvas-h3-prompt-normalizer-healthy-20261026','python','-c',code],capture_output=True,text=True);print(r.stdout);print(r.stderr);raise SystemExit(r.returncode)