auto-save 2026-05-14 11:36 (~3)

This commit is contained in:
2026-05-14 11:36:32 +08:00
parent 6f7299432d
commit 2de32523be
3 changed files with 21 additions and 20 deletions

View File

@@ -1104,10 +1104,11 @@ def _score_transparent_human_frame(img_path: Path) -> TransparentHumanFrameScore
max_tokens=1200,
)
raw = (resp.choices[0].message.content or "").strip()
if raw.startswith("```"):
import re as _re
match = _re.search(r"\{[\s\S]*\}", raw)
raw = match.group(0) if match else raw
if not raw:
raw = (getattr(resp.choices[0].message, "reasoning_content", "") or "").strip()
import re as _re
match = _re.search(r"\{[\s\S]*\}", raw)
raw = match.group(0) if match else raw
data = json.loads(raw)
except Exception as e:
return TransparentHumanFrameScore(qualified=False, reject_reason=f"AI 评分失败:{e}")
@@ -1611,7 +1612,8 @@ def _build_audio_script_sync(job_id: str, segments: list[TranscriptSegment]) ->
voice_url = _minimax_tts_sync(job_id, rewritten)
except Exception as e:
voice_error = str(e)
errors = "".join(x for x in [rewrite_error, voice_error] if x)
# 改写失败时已有本地 SKG 模板兜底,不把它标成用户可见错误;配音失败才需要提示。
errors = voice_error
return AudioScript(
status="completed",
source_text=source_text,