mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-17 15:15:17 +00:00
featured explore list sorting and support new tts model with badges
This commit is contained in:
1 parent
2a95d23f54
commit
ff9e421a3a
7 files changed
+37
-11
No files matched your search
@@ -1,5 +1,7 @@
|
||||
export enum WeightType {
|
||||
TT2 = "tt2",
|
||||
GPT_SO_VITS = "gpt_so_vits",
|
||||
TT2_5 = "tacotron2.5",
|
||||
HIFIGAN_TT2 = "hifigan_tt2",
|
||||
RVCv2 = "rvc_v2",
|
||||
SD_15 = "sd_1.5",
|
||||
|
||||
@@ -178,7 +178,7 @@ export default function AudioCard({
|
||||
label={weightBadgeLabel}
|
||||
color={weightBadgeColor}
|
||||
/>
|
||||
<span className="d-none d-lg-flex align-items-center gap-1 fs-7 opacity-50">
|
||||
<span className="d-none d-lg-flex align-items-center gap-1 fs-7 opacity-50 text-white">
|
||||
<FontAwesomeIcon icon={faThumbsUp} />
|
||||
{data?.stats?.positive_rating_count}
|
||||
</span>
|
||||
|
||||
@@ -54,6 +54,8 @@ const Cards = ({ props, type }: MediaCardsProps) => {
|
||||
case "so_vits_svc":
|
||||
return <CardWrapper {...{ ...props, card: WeightCard, padding: true }} />;
|
||||
case "tt2":
|
||||
case "tacotron2.5":
|
||||
case "gpt_so_vits":
|
||||
return <CardWrapper {...{ ...props, card: WeightCard, padding: true }} />;
|
||||
default:
|
||||
return <div>Unsupported type</div>;
|
||||
|
||||
@@ -8,9 +8,15 @@ const weightTypeInfo: WeightTypeInfo = {
|
||||
[WeightType.TT2]: { label: "TT2", color: "teal", fullLabel: "Tacotron 2" },
|
||||
[WeightType.HIFIGAN_TT2]: {
|
||||
label: "HifiGAN TT2",
|
||||
color: "blue",
|
||||
color: "aqua",
|
||||
fullLabel: "HifiGAN Tacotron 2",
|
||||
},
|
||||
[WeightType.GPT_SO_VITS]: {
|
||||
label: "TT+",
|
||||
color: "blue",
|
||||
fullLabel: "Tacotron+",
|
||||
},
|
||||
[WeightType.TT2_5]: { label: "TT+", color: "blue", fullLabel: "Tacotron+" },
|
||||
[WeightType.RVCv2]: { label: "RVC v2", color: "orange", fullLabel: "RVC v2" },
|
||||
[WeightType.SD_15]: {
|
||||
label: "SD 1.5",
|
||||
|
||||
+11
-5
@@ -1,14 +1,18 @@
|
||||
import { ListFeaturedWeights, Weight } from "@storyteller/components/src/api";
|
||||
import { useListContent } from "hooks";
|
||||
import React, { useRef, useState } from "react";
|
||||
// import prepFilter from "resources/prepFilter";
|
||||
import { MasonryGrid, WeightsCards } from "components/common";
|
||||
import prepFilter from "resources/prepFilter";
|
||||
|
||||
interface ExploreTtsProps {
|
||||
interface ExploreVoicesProps {
|
||||
onResultSelect?: (data: any) => void;
|
||||
filterCategory?: string;
|
||||
}
|
||||
|
||||
const ExploreTts = ({ onResultSelect }: ExploreTtsProps) => {
|
||||
const ExploreVoices = ({
|
||||
onResultSelect,
|
||||
filterCategory,
|
||||
}: ExploreVoicesProps) => {
|
||||
const [list, listSet] = useState<Weight[]>([]);
|
||||
const [showMasonryGrid, setShowMasonryGrid] = useState(false);
|
||||
const gridContainerRef = useRef<HTMLDivElement | null>(null);
|
||||
@@ -17,7 +21,9 @@ const ExploreTts = ({ onResultSelect }: ExploreTtsProps) => {
|
||||
urlUpdate: false,
|
||||
addQueries: {
|
||||
page_size: "48",
|
||||
// ...prepFilter("image", "filter_media_classes"),
|
||||
...(filterCategory
|
||||
? prepFilter(filterCategory, "filter_weights_categories")
|
||||
: {}),
|
||||
},
|
||||
fetcher: ListFeaturedWeights,
|
||||
list,
|
||||
@@ -87,4 +93,4 @@ const ExploreTts = ({ onResultSelect }: ExploreTtsProps) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default ExploreTts;
|
||||
export default ExploreVoices;
|
||||
@@ -30,7 +30,7 @@ import { v4 as uuidv4 } from "uuid";
|
||||
import { FrontendInferenceJobType } from "@storyteller/components/src/jobs/InferenceJob";
|
||||
import { isMobile } from "react-device-detect";
|
||||
import { useTtsStore } from "hooks";
|
||||
import ExploreTts from "../ExploreTts";
|
||||
import ExploreTts from "../ExploreVoices";
|
||||
import { AITools } from "components/marketing";
|
||||
import VoicePickerPreview from "../VoicePickerPreview";
|
||||
|
||||
@@ -67,7 +67,12 @@ export default function NewTTS({ sessionSubscriptionsWrapper }: Props) {
|
||||
inputMode: 3,
|
||||
onSearchChange: searchChange(false),
|
||||
search,
|
||||
emptyContent: <ExploreTts onResultSelect={handleResultSelect} />,
|
||||
emptyContent: (
|
||||
<ExploreTts
|
||||
onResultSelect={handleResultSelect}
|
||||
filterCategory="text_to_speech"
|
||||
/>
|
||||
),
|
||||
showFilters: false,
|
||||
showPagination: false,
|
||||
searchFilter: "text_to_speech",
|
||||
|
||||
@@ -28,7 +28,7 @@ import { v4 as uuidv4 } from "uuid";
|
||||
import { FrontendInferenceJobType } from "@storyteller/components/src/jobs/InferenceJob";
|
||||
import { isMobile } from "react-device-detect";
|
||||
import { useVcStore } from "hooks";
|
||||
import ExploreTts from "../ExploreTts";
|
||||
import ExploreVoices from "../ExploreVoices";
|
||||
import { AITools } from "components/marketing";
|
||||
import VoicePickerPreview from "../VoicePickerPreview";
|
||||
import VCRecordComponent from "./VCRecordComponent";
|
||||
@@ -86,7 +86,12 @@ export default function NewVC({ sessionSubscriptionsWrapper }: Props) {
|
||||
inputMode: 3,
|
||||
onSearchChange: searchChange(false),
|
||||
search,
|
||||
emptyContent: <ExploreTts onResultSelect={handleResultSelect} />,
|
||||
emptyContent: (
|
||||
<ExploreVoices
|
||||
onResultSelect={handleResultSelect}
|
||||
filterCategory="voice_conversion"
|
||||
/>
|
||||
),
|
||||
showFilters: false,
|
||||
showPagination: false,
|
||||
searchFilter: "voice_conversion",
|
||||
|
||||
Reference in new issue
Block a user