mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 01:38:44 +00:00
jobs enqueueing from creating voice designer voices
This commit is contained in:
1 parent
6198a59c0f
commit
a733ff7926
3 files changed
+28
-9
No files matched your search
@@ -21,7 +21,7 @@ const DEFAULT_QUEUE_REFRESH_INTERVAL_MILLIS = 15000;
|
||||
export default function InferenceJobsList({ t, inferenceJobs }: { t: any, inferenceJobs?: any }) {
|
||||
// const { inferenceJobs = [] } = useInferenceJobs({ type: 0 });
|
||||
// const oldJobs = thejobs || inferenceJobs;
|
||||
// console.log("😎",inferenceJobs);
|
||||
console.log("😎",inferenceJobs);
|
||||
const [pending, pendingSet] = useState<GetPendingTtsJobCountSuccessResponse>({
|
||||
success: true,
|
||||
pending_job_count: 0,
|
||||
|
||||
@@ -642,22 +642,31 @@ class PageContainer extends React.Component<
|
||||
<Route
|
||||
exact
|
||||
path="/voice-designer/create"
|
||||
component={VoiceDesignerFormPage}
|
||||
/>
|
||||
>
|
||||
<VoiceDesignerFormPage {...{
|
||||
enqueueInferenceJob: this.props.enqueueInferenceJob
|
||||
}}/>
|
||||
</Route>
|
||||
|
||||
{/* Route for editing the dataset details */}
|
||||
<Route
|
||||
exact
|
||||
path="/voice-designer/dataset/:dataset_token/edit"
|
||||
component={VoiceDesignerFormPage}
|
||||
/>
|
||||
>
|
||||
<VoiceDesignerFormPage {...{
|
||||
enqueueInferenceJob: this.props.enqueueInferenceJob
|
||||
}}/>
|
||||
</Route>
|
||||
|
||||
{/* Route for handling dataset token for uploading samples */}
|
||||
<Route
|
||||
exact
|
||||
path="/voice-designer/dataset/:dataset_token/upload"
|
||||
component={VoiceDesignerFormPage}
|
||||
/>
|
||||
>
|
||||
<VoiceDesignerFormPage {...{
|
||||
enqueueInferenceJob: this.props.enqueueInferenceJob
|
||||
}}/>
|
||||
</Route>
|
||||
|
||||
<Route path="/voice-designer/voice/:voice_token/edit">
|
||||
<VoiceDesignerVoiceEditPage />
|
||||
@@ -677,7 +686,10 @@ class PageContainer extends React.Component<
|
||||
</Route>
|
||||
|
||||
<Route path="/voice-designer">
|
||||
<VoiceDesignerMainPage {...{ inferenceJobs: this.props.inferenceJobs }} />
|
||||
<VoiceDesignerMainPage {...{
|
||||
enqueueInferenceJob: this.props.enqueueInferenceJob,
|
||||
inferenceJobs: this.props.inferenceJobs
|
||||
}} />
|
||||
</Route>
|
||||
|
||||
<Route path="/generate-speech">
|
||||
|
||||
@@ -22,11 +22,13 @@ import { useFile } from "hooks";
|
||||
|
||||
import useVoiceRequests from "./useVoiceRequests";
|
||||
|
||||
import { FrontendInferenceJobType } from "@storyteller/components/src/jobs/InferenceJob";
|
||||
|
||||
interface RouteParams {
|
||||
dataset_token?: string;
|
||||
}
|
||||
|
||||
function VoiceDesignerFormPage() {
|
||||
function VoiceDesignerFormPage({ enqueueInferenceJob }: { enqueueInferenceJob: any }) {
|
||||
const history = useHistory();
|
||||
const { datasets, inputCtrl, languages, visibilityOptions, voices } = useVoiceRequests({});
|
||||
const [language, languageSet] = useState("en");
|
||||
@@ -139,6 +141,11 @@ function VoiceDesignerFormPage() {
|
||||
})
|
||||
.then((res: any) => {
|
||||
if (res && res.success) {
|
||||
enqueueInferenceJob(
|
||||
res.inference_job_token,
|
||||
FrontendInferenceJobType.VoiceDesignerTts
|
||||
);
|
||||
|
||||
history.push("/voice-designer");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user