mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-14 05:42:32 +00:00
report maybe_extra_status for tts + model upload
This commit is contained in:
1 parent
e6fecb598c
commit
cbde1ab858
4 files changed
+14
-4
No files matched your search
@@ -5,15 +5,18 @@ export class TtsModelUploadJob {
|
||||
jobToken: string;
|
||||
maybeModelToken: string | undefined | null;
|
||||
jobState: JobState;
|
||||
maybeExtraStatusDescription: string | null;
|
||||
attemptCount: number;
|
||||
|
||||
constructor(
|
||||
jobToken: string,
|
||||
status: string = 'unknown',
|
||||
maybeExtraStatusDescription: string | null = null,
|
||||
attemptCount: number = 0,
|
||||
maybeModelToken: string | undefined | null = undefined
|
||||
) {
|
||||
this.jobState = jobStateFromString(status);
|
||||
this.maybeExtraStatusDescription = maybeExtraStatusDescription;
|
||||
this.attemptCount = attemptCount;
|
||||
this.jobToken = jobToken;
|
||||
if (!!maybeModelToken) {
|
||||
@@ -25,6 +28,7 @@ export class TtsModelUploadJob {
|
||||
return new TtsModelUploadJob(
|
||||
response.job_token,
|
||||
response.status,
|
||||
response.maybe_extra_status_description || null,
|
||||
response.attempt_count || 0,
|
||||
response.maybe_model_token,
|
||||
);
|
||||
@@ -39,6 +43,7 @@ export interface TtsModelUploadJobStateResponsePayload {
|
||||
export interface TtsInferenceJobState {
|
||||
job_token: string,
|
||||
status: string,
|
||||
maybe_extra_status_description: string | null,
|
||||
attempt_count: number | undefined,
|
||||
maybe_model_token: string | undefined | null,
|
||||
created_at: string,
|
||||
|
||||
@@ -4,16 +4,19 @@ import { JobState, jobStateFromString } from "./JobStates";
|
||||
export class W2lTemplateUploadJob {
|
||||
jobToken: string;
|
||||
jobState: JobState;
|
||||
maybeExtraStatusDescription: string | null;
|
||||
attemptCount: number;
|
||||
maybeW2lTemplateToken: string | undefined | null;
|
||||
|
||||
constructor(
|
||||
jobToken: string,
|
||||
status: string = 'unknown',
|
||||
maybeExtraStatusDescription: string | null = null,
|
||||
attemptCount: number = 0,
|
||||
maybeW2lTemplateToken: string | undefined | null = null
|
||||
) {
|
||||
this.jobState = jobStateFromString(status);
|
||||
this.maybeExtraStatusDescription = maybeExtraStatusDescription;
|
||||
this.attemptCount = attemptCount;
|
||||
this.jobToken = jobToken;
|
||||
if (!!maybeW2lTemplateToken) {
|
||||
@@ -25,6 +28,7 @@ export class W2lTemplateUploadJob {
|
||||
return new W2lTemplateUploadJob(
|
||||
response.job_token,
|
||||
response.status,
|
||||
response.maybe_extra_status_description || null,
|
||||
response.attempt_count || 0,
|
||||
response.maybe_template_token,
|
||||
);
|
||||
@@ -40,6 +44,7 @@ export interface W2lTemplateUploadJobState {
|
||||
job_token: string,
|
||||
maybe_template_token: string | null,
|
||||
status: string,
|
||||
maybe_extra_status_description: string | null,
|
||||
attempt_count: number | null,
|
||||
created_at: string,
|
||||
updated_at: string,
|
||||
|
||||
@@ -19,10 +19,10 @@ function SessionTtsModelUploadResultListFc(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...`;
|
||||
|
||||
@@ -19,10 +19,10 @@ function SessionW2lTemplateUploadResultListFc(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...`;
|
||||
|
||||
Reference in new issue
Block a user