tts ensure: skip whisper alignment in test namespaces
This commit is contained in:
parent
b2517bc91d
commit
3f17874fe5
1 changed files with 3 additions and 2 deletions
|
|
@ -216,6 +216,7 @@ export async function POST(request: NextRequest) {
|
||||||
const nowMs = Date.now();
|
const nowMs = Date.now();
|
||||||
const storagePrefix = getS3Config().prefix;
|
const storagePrefix = getS3Config().prefix;
|
||||||
const secret = textHmacSecret();
|
const secret = textHmacSecret();
|
||||||
|
const shouldRunWhisperAlignment = !scope.testNamespace;
|
||||||
|
|
||||||
let invalidLocatorIndex = -1;
|
let invalidLocatorIndex = -1;
|
||||||
const normalized = parsed.segments
|
const normalized = parsed.segments
|
||||||
|
|
@ -387,7 +388,7 @@ export async function POST(request: NextRequest) {
|
||||||
|
|
||||||
// Self-heal transient Whisper failures: if audio exists but alignment was
|
// Self-heal transient Whisper failures: if audio exists but alignment was
|
||||||
// previously unavailable, retry alignment using the current segment text.
|
// previously unavailable, retry alignment using the current segment text.
|
||||||
if (!alignment && !request.signal.aborted) {
|
if (shouldRunWhisperAlignment && !alignment && !request.signal.aborted) {
|
||||||
try {
|
try {
|
||||||
const alignStartedAt = Date.now();
|
const alignStartedAt = Date.now();
|
||||||
alignment = await userWhisperAlignJob({
|
alignment = await userWhisperAlignJob({
|
||||||
|
|
@ -639,7 +640,7 @@ export async function POST(request: NextRequest) {
|
||||||
const durationMs = await probeAudioDurationMsFromBuffer(persistedBuffer, request.signal);
|
const durationMs = await probeAudioDurationMsFromBuffer(persistedBuffer, request.signal);
|
||||||
stageTimings.probeDurationMs = Date.now() - probeStartedAt;
|
stageTimings.probeDurationMs = Date.now() - probeStartedAt;
|
||||||
let alignment: TTSSegmentManifestItem['alignment'] = null;
|
let alignment: TTSSegmentManifestItem['alignment'] = null;
|
||||||
if (!request.signal.aborted) {
|
if (shouldRunWhisperAlignment && !request.signal.aborted) {
|
||||||
try {
|
try {
|
||||||
failedStage = 'whisper.align';
|
failedStage = 'whisper.align';
|
||||||
const alignStartedAt = Date.now();
|
const alignStartedAt = Date.now();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue