From f4faeeabe5906cbea5269ff6f7910d8468986ae7 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 27 Aug 2021 01:21:53 -0400 Subject: [PATCH] report detailed TTS inference status --- vocodes/src/jobs/TtsInferenceJobs.ts | 5 +++++ .../src/v2/view/_common/SessionTtsInferenceResultsListFc.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/vocodes/src/jobs/TtsInferenceJobs.ts b/vocodes/src/jobs/TtsInferenceJobs.ts index 8d380051dd..5bcdda84be 100644 --- a/vocodes/src/jobs/TtsInferenceJobs.ts +++ b/vocodes/src/jobs/TtsInferenceJobs.ts @@ -5,6 +5,7 @@ export class TtsInferenceJob { jobToken: string; modelToken?: string; jobState: JobState; + maybeExtraStatusDescription: string | null; attemptCount: number; title?: string; maybeResultToken: string | undefined | null; @@ -13,6 +14,7 @@ export class TtsInferenceJob { constructor( jobToken: string, status: string = 'unknown', + maybeExtraStatusDescription: string | null = null, attemptCount: number = 0, modelToken: string | undefined = undefined, title: string | undefined = undefined, @@ -20,6 +22,7 @@ export class TtsInferenceJob { maybePublicBucketWavAudioPath: string | undefined | null = null, ) { this.jobState = jobStateFromString(status); + this.maybeExtraStatusDescription = maybeExtraStatusDescription; this.attemptCount = attemptCount; this.jobToken = jobToken; this.maybeResultToken = maybeResulToken; @@ -36,6 +39,7 @@ export class TtsInferenceJob { return new TtsInferenceJob( response.job_token, response.status, + response.maybe_extra_status_description || null, response.attempt_count || 0, response.model_token, response.title, @@ -53,6 +57,7 @@ export interface TtsInferenceJobStateResponsePayload { export interface TtsInferenceJobState { job_token: string, status: string, + maybe_extra_status_description: string | null, attempt_count: number | null, maybe_result_token: string | null, maybe_public_bucket_wav_audio_path: string | null, diff --git a/vocodes/src/v2/view/_common/SessionTtsInferenceResultsListFc.tsx b/vocodes/src/v2/view/_common/SessionTtsInferenceResultsListFc.tsx index 54cd2d5f0d..5f5093ba4c 100644 --- a/vocodes/src/v2/view/_common/SessionTtsInferenceResultsListFc.tsx +++ b/vocodes/src/v2/view/_common/SessionTtsInferenceResultsListFc.tsx @@ -20,10 +20,10 @@ function SessionTtsInferenceResultListFc(props: Props) { switch (job.jobState) { case JobState.PENDING: case JobState.UNKNOWN: - stateDescription = "Pending..." + stateDescription = job.maybeExtraStatusDescription == null ? "Pending..." : job.maybeExtraStatusDescription; break; case JobState.STARTED: - stateDescription = "Started..."; + stateDescription = job.maybeExtraStatusDescription == null ? "Started..." : job.maybeExtraStatusDescription; break; case JobState.ATTEMPT_FAILED: stateDescription = `Failed ${job.attemptCount} attempt(s). Will retry...`;