index, terms, about page

This commit is contained in:
BFlat authored and Brandon Thomas committed 2022-07-10 18:38:31 -04:00
1 parent 06ba2906e4
commit 92330cc529
7 files changed
+429 -322

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

+9 -5
View File
@@ -121,6 +121,8 @@ nav {
padding-left: 16px !important;
padding-right: 16px !important;
color: $light-text-color;
display: flex;
align-items: center;
}
.navbar-brand {
@@ -131,10 +133,12 @@ nav {
font-size: 15px;
font-weight: 600;
padding: 0.5rem 1rem;
}
display: flex;
align-items: center;
.dropdown-item:active {
background-color: #fc6b68;
&:active {
background-color: #fc6b68;
}
}
.dropdown-menu {
@@ -163,7 +167,7 @@ nav {
transition: 0.1s;
&:hover {
color: rgba(255, 255, 255, 0.6);
color: rgba($white, 0.6);
text-decoration: none;
transition: 0.1s;
}
@@ -173,7 +177,7 @@ nav {
.top-bar {
display: flex;
align-items: center;
background-color: rgba(255, 255, 255, 0.05);
background-color: rgba($white, 0.05);
margin-bottom: 5px;
padding: 10px 0;
backdrop-filter: blur(5px);
@@ -50,10 +50,19 @@ label:focus,
box-shadow: none !important;
}
code {
color: $primary;
background-color: rgba($white, 0.06);
}
.text-link {
color: $primary;
}
.text-light {
color: rgba($white, 0.7) !important;
}
.container {
max-width: 1080px !important;
}
@@ -104,6 +113,22 @@ label:focus,
background-color: lighten($primary, 5%) !important;
}
.btn-secondary,
.btn-secondary:focus,
.btn-secondary:active {
background-color: #fff;
color: #212529;
border: 2.5px solid;
border-color: #fff;
transition: 0.2s;
}
.btn-secondary:hover {
background-color: #ccc;
color: #212529;
border: 2.5px solid;
border-color: #ccc;
}
.panel {
position: relative;
width: 100%;
+34 -16
View File
@@ -5,6 +5,11 @@ import { MigrationTopNavSession } from "../../migration/MigrationTopNav_Session"
import { FrontendUrlConfig } from "../../common/FrontendUrlConfig";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {
faMicrophone,
faPlus,
faUsers,
faVideo,
faHeadphones,
faGavel,
faGrinBeamSweat,
faList,
@@ -54,13 +59,16 @@ function NewTopNavFc(props: Props) {
<div className="top-bar d-none d-lg-flex">
<div className="container d-flex">
<div className="d-flex gap-4 flex-grow-1">
<a className="top-bar-text" href="about.html">
<Link className="top-bar-text" to="/about">
About
</a>
<a className="top-bar-text" href="terms.html">
</Link>
<Link className="top-bar-text" to="/terms">
Terms of Use
</a>
<a className="top-bar-text" href="#">
</Link>
<a
className="top-bar-text"
href={FrontendUrlConfig.developerDocs()}
>
Developers
</a>
<a
@@ -113,9 +121,13 @@ function NewTopNavFc(props: Props) {
aria-labelledby="offcanvasNavbar2Label"
>
<div className="offcanvas-header">
<a className="navbar-brand me-5 pr-8" href="#">
<img src="assets/FakeYou-Logo-Left.png" alt="" height="34" />
</a>
<Link className="navbar-brand me-5 pr-8" to="/">
<img
src="fakeyou/FakeYou-Logo.png"
alt="FakeYou: Cartoon and Celebrity Text to Speech"
height="34"
/>
</Link>
<button
type="button"
@@ -131,6 +143,7 @@ function NewTopNavFc(props: Props) {
to={FrontendUrlConfig.cloneRequestPage()}
className="nav-link"
>
<FontAwesomeIcon icon={faMicrophone} className="me-2" />
Clone My Voice!
</Link>
</li>
@@ -144,7 +157,8 @@ function NewTopNavFc(props: Props) {
data-bs-toggle="dropdown"
aria-expanded="false"
>
<i className="fa-solid fa-plus me-2"></i>Create
<FontAwesomeIcon icon={faPlus} className="me-2" />
Create
</a>
<ul
className="dropdown-menu"
@@ -152,12 +166,14 @@ function NewTopNavFc(props: Props) {
>
<li>
<a className="dropdown-item" href="index.html">
<i className="fa-solid fa-volume-high me-2"></i>TTS
<FontAwesomeIcon icon={faMicrophone} className="me-2" />
TTS
</a>
</li>
<li>
<a className="dropdown-item" href="video.html">
<i className="fa-solid fa-video me-2"></i>Video
<FontAwesomeIcon icon={faVideo} className="me-2" />
Video
</a>
</li>
</ul>
@@ -171,21 +187,23 @@ function NewTopNavFc(props: Props) {
role="button"
data-bs-toggle="dropdown"
>
<i className="fa-solid fa-users me-2"></i>Community
<FontAwesomeIcon icon={faUsers} className="me-2" />
Community
</a>
<ul
className="dropdown-menu"
aria-labelledby="offcanvasNavbarLgDropdown"
>
<li>
<a className="dropdown-item" href="contribute.html">
<i className="fa-solid fa-upload me-2"></i>
<Link className="dropdown-item" to="/contribute">
<FontAwesomeIcon icon={faMicrophone} className="me-2" />
Contribute/Upload
</a>
</Link>
</li>
<li>
<a className="dropdown-item" href="leaderboard.html">
<i className="fa-solid fa-trophy me-2"></i>Leaderboard
<FontAwesomeIcon icon={faMicrophone} className="me-2" />
Leaderboard
</a>
</li>
<li>
@@ -249,25 +249,28 @@ function AboutPage(props: Props) {
</div>
<div>
<h2 className="mb-4">Built With</h2>
<div className="d-flex gap-3 w-100">
<img
className="rounded img-fluid"
src="/logos/pytorch.png"
alt="models are written in pytorch"
width="200"
/>
<img
className="rounded img-fluid"
src="/logos/rust.png"
alt="core server components are written in Rust"
width="200"
/>
<img
className="rounded img-fluid"
src="/logos/kubernetes.png"
alt="the cluster scales with k8s"
width="200"
/>
<div className="row">
<div className="col-4 col-md-3">
<img
className="rounded img-fluid"
src="/logos/pytorch.png"
alt="models are written in pytorch"
/>
</div>
<div className="col-4 col-md-3">
<img
className="rounded img-fluid"
src="/logos/rust.png"
alt="core server components are written in Rust"
/>
</div>
<div className="col-4 col-md-3">
<img
className="rounded img-fluid"
src="/logos/kubernetes.png"
alt="the cluster scales with k8s"
/>
</div>
</div>
</div>
</div>
@@ -1,82 +1,79 @@
import React from 'react';
import React from "react";
interface Props {
}
interface Props {}
function TermsPage(props: Props) {
return (
<div className="content is-medium">
<section className="hero is-small">
<div className="hero-body">
<div className="columns is-vcentered">
<div className="column is-one-third">
<div className="mascot">
<img src="/mascot/kitsune_pose1_black_2000.webp" alt="FakeYou Kitsune Mascot!" />
</div>
</div>
<div className="column">
<p className="title">
Terms and Conditions
</p>
<p className="subtitle">
Please use this technology responsibly.
</p>
</div>
</div>
<div>
<div className="container py-5">
<div className="d-flex flex-column">
<h1 className="display-5 fw-bold">Terms and Conditions</h1>
<h4 className="mb-4 text-light">
Please use this technology responsibly.
</h4>
</div>
</section>
</div>
<h1 className="title is-4">Terms of Use</h1>
<div className="container-panel pt-4 pb-5">
<div className="panel p-3 p-lg-4 load-hidden mt-5 mt-lg-0">
<h1 className="panel-title fw-bold">Terms of Use</h1>
<div className="py-6 d-flex flex-column gap-4">
<p>
We do not condone the use of FakeYou for any type of deception,
slur, abuse, or mistreatment of any individual or group. Please
report such abuses to our{" "}
<a href="https://discord.gg/H72KFXm">
community staff on Discord
</a>
. Bad actors will have their access revoked and materials deleted.
</p>
<p>
This is a research technology for fun. You may not use FakeYou
deepfakes for commercial use.
</p>
<p>
Do not engage in unlawful activity or attempt to impersonate any
person, company, or other entity. All published usages must be
labled as "deep fake".
</p>
<p>
<em>
The audio we generate is watermarked, and we will soon release a
tool to verify that it is deep fake generated and trace it back
to its source.
</em>
</p>
<p>
We do not condone the use of FakeYou for any type of deception, slur,
abuse, or mistreatment of any individual or group. Please report such
abuses to our <a href="https://discord.gg/H72KFXm">community staff on Discord</a>.
Bad actors will have their access revoked and materials deleted.
</p>
<p>
This is a research technololgy for fun. You may not use FakeYou deepfakes
for commercial use.
</p>
<p>
Do not engage in unlawful activity or attempt to impersonate any person,
company, or other entity. All published usages must be labled as "deep fake".
</p>
<p>
<em>The audio we generate is watermarked, and we will soon release a tool to
verify that it is deep fake generated and trace it back to its source.</em>
</p>
<h1 className="title is-5">Takedown Requests</h1>
<p>
The machine learning models and content at FakeYou are user-submitted, but we'll be happy to
remove content for any reason for copyright holders, original speakers, voice actors, et al.
Please send us an email to <code>copyright@storyteller.io</code> with details in order to
request a takedown.
</p>
<h1 className="title is-5">Voice Acting &amp; Musician Jobs</h1>
<p>
If you're a voice actor or musician, we're looking to hire talented performers to help us build
commercial-friendly AI voices. (The user-submitted models on FakeYou are just a technology
demonstration and may not be used commercially.) We want to empower small creators (game
designers, musicians, and more) to voice, sing, and speak emotion into their work. Please reach
out to <code>jobs@storyteller.io</code> if you'd like to work with us. We can pay a flat fee
and/or royalty. Please get in touch to learn more!
</p>
<div>
<h2 className="mb-4">Takedown Requests</h2>
<p>
The machine learning models and content at FakeYou are
user-submitted, but we'll be happy to remove content for any
reason for copyright holders, original speakers, voice actors,
et al. Please send us an email to{" "}
<code>copyright@storyteller.io</code> with details in order to
request a takedown.
</p>
</div>
<div>
<h2 className="mb-4">Voice Acting & Musician Jobs</h2>
<p>
If you're a voice actor or musician, we're looking to hire
talented performers to help us build commercial-friendly AI
voices. (The user-submitted models on FakeYou are just a
technology demonstration and may not be used commercially.) We
want to empower small creators (game designers, musicians, and
more) to voice, sing, and speak emotion into their work. Please
reach out to <code>jobs@storyteller.io</code> if you'd like to
work with us. We can pay a flat fee and/or royalty. Please get
in touch to learn more!
</p>
</div>
</div>
</div>
</div>
</div>
)
);
}
export { TermsPage };
@@ -1,91 +1,104 @@
import React, { useEffect, useCallback, useState } from 'react';
import { Link } from 'react-router-dom';
import { SessionTtsInferenceResultListFc } from '../../_common/SessionTtsInferenceResultsListFc';
import { SessionTtsModelUploadResultListFc } from '../../_common/SessionTtsModelUploadResultsListFc';
import { SessionW2lInferenceResultListFc } from '../../_common/SessionW2lInferenceResultsListFc';
import { SessionW2lTemplateUploadResultListFc } from '../../_common/SessionW2lTemplateUploadResultsListFc';
import { SessionWrapper } from '@storyteller/components/src/session/SessionWrapper';
import { Gravatar } from '@storyteller/components/src/elements/Gravatar';
import { TtsInferenceJob } from '@storyteller/components/src/jobs/TtsInferenceJobs';
import { TtsModelUploadJob } from '@storyteller/components/src/jobs/TtsModelUploadJobs';
import { W2lInferenceJob } from '@storyteller/components/src/jobs/W2lInferenceJobs';
import { W2lTemplateUploadJob } from '@storyteller/components/src/jobs/W2lTemplateUploadJobs';
import { v4 as uuidv4 } from 'uuid';
import { ListTtsModels, TtsModelListItem } from '@storyteller/components/src/api/tts/ListTtsModels';
import { GenerateTtsAudio, GenerateTtsAudioErrorType, GenerateTtsAudioIsError, GenerateTtsAudioIsOk } from '@storyteller/components/src/api/tts/GenerateTtsAudio';
import { VocodesNotice } from './notices/VocodesNotice';
import { ListTtsCategories, ListTtsCategoriesIsError, ListTtsCategoriesIsOk } from '../../../api/category/ListTtsCategories';
import { MultiDropdownSearch } from './MultiDropdownSearch';
import { SyntheticCategory, TtsCategoryType } from '../../../../AppWrapper';
import { AutocompleteSearch } from './AutocompleteSearch';
import { LanguageNotice } from './notices/LanguageNotice';
import { Language } from '@storyteller/components/src/i18n/Language';
import { t } from 'i18next';
import { Trans } from 'react-i18next';
import { TwitchTtsNotice } from './notices/TwitchTtsNotice';
import { PleaseFollowNotice } from './notices/PleaseFollowNotice';
import React, { useEffect, useCallback, useState } from "react";
import { Link } from "react-router-dom";
import { SessionTtsInferenceResultListFc } from "../../_common/SessionTtsInferenceResultsListFc";
import { SessionTtsModelUploadResultListFc } from "../../_common/SessionTtsModelUploadResultsListFc";
import { SessionW2lInferenceResultListFc } from "../../_common/SessionW2lInferenceResultsListFc";
import { SessionW2lTemplateUploadResultListFc } from "../../_common/SessionW2lTemplateUploadResultsListFc";
import { SessionWrapper } from "@storyteller/components/src/session/SessionWrapper";
import { Gravatar } from "@storyteller/components/src/elements/Gravatar";
import { TtsInferenceJob } from "@storyteller/components/src/jobs/TtsInferenceJobs";
import { TtsModelUploadJob } from "@storyteller/components/src/jobs/TtsModelUploadJobs";
import { W2lInferenceJob } from "@storyteller/components/src/jobs/W2lInferenceJobs";
import { W2lTemplateUploadJob } from "@storyteller/components/src/jobs/W2lTemplateUploadJobs";
import { v4 as uuidv4 } from "uuid";
import {
ListTtsModels,
TtsModelListItem,
} from "@storyteller/components/src/api/tts/ListTtsModels";
import {
GenerateTtsAudio,
GenerateTtsAudioErrorType,
GenerateTtsAudioIsError,
GenerateTtsAudioIsOk,
} from "@storyteller/components/src/api/tts/GenerateTtsAudio";
import { VocodesNotice } from "./notices/VocodesNotice";
import {
ListTtsCategories,
ListTtsCategoriesIsError,
ListTtsCategoriesIsOk,
} from "../../../api/category/ListTtsCategories";
import { MultiDropdownSearch } from "./MultiDropdownSearch";
import { SyntheticCategory, TtsCategoryType } from "../../../../AppWrapper";
import { AutocompleteSearch } from "./AutocompleteSearch";
import { LanguageNotice } from "./notices/LanguageNotice";
import { Language } from "@storyteller/components/src/i18n/Language";
import { t } from "i18next";
import { Trans } from "react-i18next";
import { TwitchTtsNotice } from "./notices/TwitchTtsNotice";
import { PleaseFollowNotice } from "./notices/PleaseFollowNotice";
export interface EnqueueJobResponsePayload {
success: boolean,
inference_job_token?: string,
success: boolean;
inference_job_token?: string;
}
interface Props {
sessionWrapper: SessionWrapper,
sessionWrapper: SessionWrapper;
isShowingVocodesNotice: boolean,
clearVocodesNotice: () => void,
isShowingVocodesNotice: boolean;
clearVocodesNotice: () => void;
isShowingLanguageNotice: boolean,
clearLanguageNotice: () => void,
displayLanguage: Language,
isShowingLanguageNotice: boolean;
clearLanguageNotice: () => void;
displayLanguage: Language;
isShowingTwitchTtsNotice: boolean,
clearTwitchTtsNotice: () => void,
isShowingTwitchTtsNotice: boolean;
clearTwitchTtsNotice: () => void;
isShowingPleaseFollowNotice: boolean,
clearPleaseFollowNotice: () => void,
isShowingPleaseFollowNotice: boolean;
clearPleaseFollowNotice: () => void;
enqueueTtsJob: (jobToken: string) => void,
ttsInferenceJobs: Array<TtsInferenceJob>,
ttsModelUploadJobs: Array<TtsModelUploadJob>,
w2lInferenceJobs: Array<W2lInferenceJob>,
w2lTemplateUploadJobs: Array<W2lTemplateUploadJob>,
textBuffer: string,
setTextBuffer: (textBuffer: string) => void,
clearTextBuffer: () => void,
enqueueTtsJob: (jobToken: string) => void;
ttsInferenceJobs: Array<TtsInferenceJob>;
ttsModelUploadJobs: Array<TtsModelUploadJob>;
w2lInferenceJobs: Array<W2lInferenceJob>;
w2lTemplateUploadJobs: Array<W2lTemplateUploadJob>;
textBuffer: string;
setTextBuffer: (textBuffer: string) => void;
clearTextBuffer: () => void;
ttsModels: Array<TtsModelListItem>,
setTtsModels: (ttsVoices: Array<TtsModelListItem>) => void,
ttsModels: Array<TtsModelListItem>;
setTtsModels: (ttsVoices: Array<TtsModelListItem>) => void;
allTtsCategories: TtsCategoryType[],
setAllTtsCategories: (allTtsCategories: TtsCategoryType[]) => void,
allTtsCategories: TtsCategoryType[];
setAllTtsCategories: (allTtsCategories: TtsCategoryType[]) => void;
allTtsCategoriesByTokenMap: Map<string,TtsCategoryType>,
allTtsModelsByTokenMap: Map<string,TtsModelListItem>,
ttsModelsByCategoryToken: Map<string,Set<TtsModelListItem>>,
allTtsCategoriesByTokenMap: Map<string, TtsCategoryType>;
allTtsModelsByTokenMap: Map<string, TtsModelListItem>;
ttsModelsByCategoryToken: Map<string, Set<TtsModelListItem>>;
dropdownCategories: TtsCategoryType[][],
setDropdownCategories: (dropdownCategories: TtsCategoryType[][]) => void,
selectedCategories: TtsCategoryType[],
setSelectedCategories: (selectedCategories: TtsCategoryType[]) => void,
dropdownCategories: TtsCategoryType[][];
setDropdownCategories: (dropdownCategories: TtsCategoryType[][]) => void;
selectedCategories: TtsCategoryType[];
setSelectedCategories: (selectedCategories: TtsCategoryType[]) => void;
maybeSelectedTtsModel?: TtsModelListItem,
setMaybeSelectedTtsModel: (maybeSelectedTtsModel: TtsModelListItem) => void,
maybeSelectedTtsModel?: TtsModelListItem;
setMaybeSelectedTtsModel: (maybeSelectedTtsModel: TtsModelListItem) => void;
}
function TtsModelListFc(props: Props) {
let {
setTtsModels,
setAllTtsCategories,
ttsModels,
let {
setTtsModels,
setAllTtsCategories,
ttsModels,
allTtsCategories,
maybeSelectedTtsModel,
setMaybeSelectedTtsModel,
} = props;
const [maybeTtsError, setMaybeTtsError] = useState<GenerateTtsAudioErrorType|undefined>(undefined);
const [maybeTtsError, setMaybeTtsError] = useState<
GenerateTtsAudioErrorType | undefined
>(undefined);
const ttsModelsLoaded = ttsModels.length > 0;
const ttsCategoriesLoaded = allTtsCategories.length > 0;
@@ -100,17 +113,21 @@ function TtsModelListFc(props: Props) {
setTtsModels(models);
if (!maybeSelectedTtsModel && models.length > 0) {
let model = models[0];
const featuredModels = models.filter(m => m.is_front_page_featured);
const featuredModels = models.filter((m) => m.is_front_page_featured);
if (featuredModels.length > 0) {
// Random featured model
model = featuredModels[
Math.floor(Math.random()*featuredModels.length)
];
model =
featuredModels[Math.floor(Math.random() * featuredModels.length)];
}
setMaybeSelectedTtsModel(model);
}
}
}, [setTtsModels, maybeSelectedTtsModel, setMaybeSelectedTtsModel, ttsModelsLoaded]);
}, [
setTtsModels,
maybeSelectedTtsModel,
setMaybeSelectedTtsModel,
ttsModelsLoaded,
]);
const listTtsCategories = useCallback(async () => {
if (ttsCategoriesLoaded) {
@@ -118,11 +135,12 @@ function TtsModelListFc(props: Props) {
}
const categoryList = await ListTtsCategories();
if (ListTtsCategoriesIsOk(categoryList)) {
const serverCategories : TtsCategoryType[] = categoryList.categories;
const dynamicCategories : TtsCategoryType[] = generateSyntheticCategories();
const serverCategories: TtsCategoryType[] = categoryList.categories;
const dynamicCategories: TtsCategoryType[] =
generateSyntheticCategories();
const allCategories = serverCategories.concat(dynamicCategories);
setAllTtsCategories(allCategories);
} else if (ListTtsCategoriesIsError(categoryList)) {
} else if (ListTtsCategoriesIsError(categoryList)) {
// TODO: Retry on decay function
}
}, [setAllTtsCategories, ttsCategoriesLoaded]);
@@ -135,12 +153,12 @@ function TtsModelListFc(props: Props) {
// TODO: I never did anything with this.
let remainingCharactersButtonDisabled = false;
const handleChangeText = (ev: React.FormEvent<HTMLTextAreaElement>) => {
const handleChangeText = (ev: React.FormEvent<HTMLTextAreaElement>) => {
const textValue = (ev.target as HTMLTextAreaElement).value;
props.setTextBuffer(textValue);
};
const handleFormSubmit = async (ev: React.FormEvent<HTMLFormElement>) => {
const handleFormSubmit = async (ev: React.FormEvent<HTMLFormElement>) => {
ev.preventDefault();
if (!props.maybeSelectedTtsModel) {
@@ -157,9 +175,9 @@ function TtsModelListFc(props: Props) {
uuid_idempotency_token: uuidv4(),
tts_model_token: modelToken,
inference_text: props.textBuffer,
}
};
const response = await GenerateTtsAudio(request)
const response = await GenerateTtsAudio(request);
if (GenerateTtsAudioIsOk(response)) {
setMaybeTtsError(undefined);
@@ -171,7 +189,7 @@ function TtsModelListFc(props: Props) {
return false;
};
const handleClearClick = (ev: React.FormEvent<HTMLButtonElement>) => {
const handleClearClick = (ev: React.FormEvent<HTMLButtonElement>) => {
ev.preventDefault();
props.clearTextBuffer();
return false;
@@ -185,60 +203,69 @@ function TtsModelListFc(props: Props) {
let userName = props.maybeSelectedTtsModel.creator_display_name;
directViewLink = (
<Link to={modelLink}>
<Trans i18nKey='ttsListPage.seeModelDetails'>
See more details about the "<strong>{{modelName}}</strong>" model
by&nbsp;<strong>{{userName}}</strong>&nbsp;
<Trans i18nKey="ttsListPage.seeModelDetails">
See more details about the "<strong>{{ modelName }}</strong>" model
by&nbsp;<strong>{{ userName }}</strong>&nbsp;
</Trans>
<Gravatar
size={15}
username={props.maybeSelectedTtsModel.creator_display_name}
email_hash={props.maybeSelectedTtsModel.creator_gravatar_hash} />
<Gravatar
size={15}
username={props.maybeSelectedTtsModel.creator_display_name}
email_hash={props.maybeSelectedTtsModel.creator_gravatar_hash}
/>
</Link>
);
}
const vocodesNotice = props.isShowingVocodesNotice ?
<VocodesNotice clearVocodesNotice={props.clearVocodesNotice} /> :
undefined;
const vocodesNotice = props.isShowingVocodesNotice ? (
<VocodesNotice clearVocodesNotice={props.clearVocodesNotice} />
) : undefined;
const languageNotice = props.isShowingLanguageNotice?
<LanguageNotice clearLanguageNotice={props.clearLanguageNotice} displayLanguage={props.displayLanguage} /> :
undefined;
const languageNotice = props.isShowingLanguageNotice ? (
<LanguageNotice
clearLanguageNotice={props.clearLanguageNotice}
displayLanguage={props.displayLanguage}
/>
) : undefined;
const twitchTtsNotice = props.isShowingTwitchTtsNotice ?
<TwitchTtsNotice clearTwitchTtsNotice={props.clearTwitchTtsNotice} /> :
undefined;
const twitchTtsNotice = props.isShowingTwitchTtsNotice ? (
<TwitchTtsNotice clearTwitchTtsNotice={props.clearTwitchTtsNotice} />
) : undefined;
const pleaseFollowNotice = props.isShowingPleaseFollowNotice ?
<PleaseFollowNotice clearPleaseFollowNotice={props.clearPleaseFollowNotice} /> :
undefined;
const pleaseFollowNotice = props.isShowingPleaseFollowNotice ? (
<PleaseFollowNotice
clearPleaseFollowNotice={props.clearPleaseFollowNotice}
/>
) : undefined;
// Show errors on TTS failure
let maybeError = <></>;
if (!!maybeTtsError) {
let hasMessage = false;
let message = <></>;
switch(maybeTtsError) {
switch (maybeTtsError) {
case GenerateTtsAudioErrorType.TooManyRequests:
hasMessage = true;
message = (
<Trans i18nKey="pages.ttsList.errorTooManyRequests">
<strong>You're sending too many requests!</strong>
Slow down a little. We have to slow things down a little when the server gets busy.
<strong>You're sending too many requests!</strong>
Slow down a little. We have to slow things down a little when the
server gets busy.
</Trans>
)
);
break;
case GenerateTtsAudioErrorType.ServerError |
GenerateTtsAudioErrorType.BadRequest |
GenerateTtsAudioErrorType.NotFound:
case GenerateTtsAudioErrorType.ServerError |
GenerateTtsAudioErrorType.BadRequest |
GenerateTtsAudioErrorType.NotFound:
break;
}
if (hasMessage) {
maybeError = (
<div className="notification is-warning">
<button className="delete" onClick={() => setMaybeTtsError(undefined)}></button>
<button
className="delete"
onClick={() => setMaybeTtsError(undefined)}
></button>
{message}
</div>
);
@@ -247,36 +274,48 @@ function TtsModelListFc(props: Props) {
return (
<div>
<section className="hero is-small">
<div className="hero-body">
<div className="columns is-vcentered">
<div className="column is-one-third">
<div className="mascot">
<img src="/mascot/kitsune_pose2_black_2000.webp" alt="FakeYou's mascot!" />
<div className="container hero-section">
<div className="row gx-3 flex-lg-row-reverse align-items-center">
<div className="col-lg-6">
<div className="d-flex justify-content-center">
<img
src="mascot/kitsune_pose2.png"
className="ani4 load-hidden img-fluid"
width="560"
loading="lazy"
/>
</div>
</div>
<div className="col-lg-6 px-md-2 px-lg-5 px-xl-2">
<div>
<h1 className="ani1 load-hidden display-3 fw-bold lh-1 mb-3 text-center text-lg-start">
Text to Speech
</h1>
<div className="d-flex justify-content-center">
<p className="ani2 load-hidden lead mb-5 text-center text-lg-start">
<Trans i18nKey="pages.ttsList.heroSubtitle">
Use FakeYou's deepfake tech to say stuff with your favorite
characters.
</Trans>
</p>
</div>
</div>
<div className="column">
<p className="title">
{t('pages.ttsList.heroTitle')}
</p>
<p className="subtitle">
<Trans i18nKey="pages.ttsList.heroSubtitle">
Use <strong>FakeYou</strong> deep fake tech to say stuff with your
favorite characters.
</Trans>
</p>
<div className="ani3 load-hidden d-grid gap-3 d-lg-flex justify-content-lg-start mb-4">
<Link to="/">
<button type="button" className="btn btn-primary w-100">
Sign Up
</button>
</Link>
<Link to="/clone">
<button type="button" className="btn btn-secondary w-100">
Clone My Voice!
</button>
</Link>
</div>
</div>
</div>
</section>
<br />
</div>
{pleaseFollowNotice}
@@ -286,136 +325,157 @@ function TtsModelListFc(props: Props) {
{twitchTtsNotice}
<form onSubmit={handleFormSubmit} className="main-form">
<div className="container-panel pt-4 pb-5">
<div className="panel p-3 p-lg-4 load-hidden mt-5 mt-lg-0">
<h1 className="panel-title fw-bold">Create TTS</h1>
<div className="py-6">
<div className="d-flex flex-column gap-4">
<form onSubmit={handleFormSubmit}>
<MultiDropdownSearch
allTtsCategories={props.allTtsCategories}
allTtsModels={props.ttsModels}
allTtsCategoriesByTokenMap={props.allTtsCategoriesByTokenMap}
allTtsModelsByTokenMap={props.allTtsModelsByTokenMap}
ttsModelsByCategoryToken={props.ttsModelsByCategoryToken}
dropdownCategories={props.dropdownCategories}
setDropdownCategories={props.setDropdownCategories}
selectedCategories={props.selectedCategories}
setSelectedCategories={props.setSelectedCategories}
maybeSelectedTtsModel={props.maybeSelectedTtsModel}
setMaybeSelectedTtsModel={props.setMaybeSelectedTtsModel}
/>
<MultiDropdownSearch
allTtsCategories={props.allTtsCategories}
allTtsModels={props.ttsModels}
allTtsCategoriesByTokenMap={props.allTtsCategoriesByTokenMap}
allTtsModelsByTokenMap={props.allTtsModelsByTokenMap}
ttsModelsByCategoryToken={props.ttsModelsByCategoryToken}
dropdownCategories={props.dropdownCategories}
setDropdownCategories={props.setDropdownCategories}
selectedCategories={props.selectedCategories}
setSelectedCategories={props.setSelectedCategories}
maybeSelectedTtsModel={props.maybeSelectedTtsModel}
setMaybeSelectedTtsModel={props.setMaybeSelectedTtsModel}
/>
<AutocompleteSearch
allTtsCategories={props.allTtsCategories}
allTtsModels={props.ttsModels}
allTtsModelsByTokenMap={props.allTtsModelsByTokenMap}
dropdownCategories={props.dropdownCategories}
setDropdownCategories={props.setDropdownCategories}
selectedCategories={props.selectedCategories}
setSelectedCategories={props.setSelectedCategories}
maybeSelectedTtsModel={props.maybeSelectedTtsModel}
setMaybeSelectedTtsModel={props.setMaybeSelectedTtsModel}
/>
<AutocompleteSearch
allTtsCategories={props.allTtsCategories}
allTtsModels={props.ttsModels}
allTtsModelsByTokenMap={props.allTtsModelsByTokenMap}
dropdownCategories={props.dropdownCategories}
setDropdownCategories={props.setDropdownCategories}
selectedCategories={props.selectedCategories}
setSelectedCategories={props.setSelectedCategories}
maybeSelectedTtsModel={props.maybeSelectedTtsModel}
setMaybeSelectedTtsModel={props.setMaybeSelectedTtsModel}
/>
{directViewLink}
{directViewLink}
<div className="field">
<div className="control">
<textarea
onChange={handleChangeText}
className="textarea is-large"
value={props.textBuffer}
placeholder={t("pages.ttsList.placeholderTextGoesHere")}
></textarea>
</div>
</div>
<br />
<br />
{maybeError}
<div className="field">
<div className="control">
<textarea
onChange={handleChangeText}
className="textarea is-large"
value={props.textBuffer}
placeholder={t('pages.ttsList.placeholderTextGoesHere')}></textarea>
</div>
</div>
{maybeError}
<div className="button-group">
<div className="columns is-mobile">
<div className="column has-text-centered">
<button
className="button is-danger is-large"
disabled={remainingCharactersButtonDisabled}>{t('pages.ttsList.buttonSpeak')}</button>
</div>
<div className="column has-text-centered">
<button
className="button is-danger is-light is-large"
onClick={handleClearClick}>{t('pages.ttsList.buttonClear')}</button>
<div className="button-group">
<div className="columns is-mobile">
<div className="column has-text-centered">
<button
className="button is-danger is-large"
disabled={remainingCharactersButtonDisabled}
>
{t("pages.ttsList.buttonSpeak")}
</button>
</div>
<div className="column has-text-centered">
<button
className="button is-danger is-light is-large"
onClick={handleClearClick}
>
{t("pages.ttsList.buttonClear")}
</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</form>
</div>
<br />
<br />
<SessionTtsInferenceResultListFc ttsInferenceJobs={props.ttsInferenceJobs} />
<SessionTtsInferenceResultListFc
ttsInferenceJobs={props.ttsInferenceJobs}
/>
<br />
<br />
<SessionW2lInferenceResultListFc
w2lInferenceJobs={props.w2lInferenceJobs}
/>
/>
<br />
<br />
<SessionW2lTemplateUploadResultListFc
w2lTemplateUploadJobs={props.w2lTemplateUploadJobs}
/>
/>
<br />
<br />
<SessionTtsModelUploadResultListFc
modelUploadJobs={props.ttsModelUploadJobs}
/>
/>
</div>
)
);
}
function generateSyntheticCategories() : SyntheticCategory[] {
function generateSyntheticCategories(): SyntheticCategory[] {
return [
// Under-categorized
new SyntheticCategory('Under-categorized Models', 'syn:under'),
new SyntheticCategory('With 0 categories', 'syn:uncategorized', 'syn:under'),
new SyntheticCategory('With 1 category', 'syn:one-category', 'syn:under'),
new SyntheticCategory("Under-categorized Models", "syn:under"),
new SyntheticCategory(
"With 0 categories",
"syn:uncategorized",
"syn:under"
),
new SyntheticCategory("With 1 category", "syn:one-category", "syn:under"),
// Most recent
new SyntheticCategory('Most Recent Voices', 'syn:most-recent'),
]
new SyntheticCategory("Most Recent Voices", "syn:most-recent"),
];
}
// Directly mutate the model records
function dynamicallyCategorizeModels(models: TtsModelListItem[]) {
// NB: Sorting by creation date will involve more refactoring, so this is fine for now.
const mostRecentModelTokens = new Set([...models].sort((modelA, modelB) => {
const dateA = new Date(modelA.created_at);
const dateB = new Date(modelB.created_at);
if (dateA > dateB) {
return -1;
} else if (dateA < dateB) {
return 1;
} else {
return 0;
}
}).map(model => model.model_token).slice(0, 25));
const mostRecentModelTokens = new Set(
[...models]
.sort((modelA, modelB) => {
const dateA = new Date(modelA.created_at);
const dateB = new Date(modelB.created_at);
if (dateA > dateB) {
return -1;
} else if (dateA < dateB) {
return 1;
} else {
return 0;
}
})
.map((model) => model.model_token)
.slice(0, 25)
);
models.forEach(model => {
models.forEach((model) => {
if (!model.category_tokens) {
model.category_tokens = [];
}
if (model.category_tokens.length === 1) {
model.category_tokens.push('syn:one-category');
model.category_tokens.push("syn:one-category");
} else if (model.category_tokens.length === 0) {
model.category_tokens.push('syn:uncategorized');
model.category_tokens.push("syn:uncategorized");
}
if (mostRecentModelTokens.has(model.model_token)) {
model.category_tokens.push('syn:most-recent');
model.category_tokens.push("syn:most-recent");
}
})
});
}
export { TtsModelListFc };