mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-06 02:00:46 +00:00
Merge pull request #505 from storytold/feature/page/workflow_upload
now profile library can show uploaded workflows
This commit is contained in:
3 files changed
+14
-12
No files matched your search
@@ -4,4 +4,5 @@ export enum WeightCategory {
|
||||
VC = "voice_conversion",
|
||||
ZS = "zero_shot",
|
||||
SD = "image_generation",
|
||||
WF = "workflow_config",
|
||||
}
|
||||
@@ -9,12 +9,14 @@ interface Props {
|
||||
}
|
||||
|
||||
export default function WeightsCards({ props, type }: Props) {
|
||||
console.log(props);
|
||||
switch (type) {
|
||||
case WeightCategory.TTS:
|
||||
case WeightCategory.VC:
|
||||
case WeightCategory.ZS:
|
||||
return <AudioCard { ...props} showCover />;
|
||||
case WeightCategory.SD:
|
||||
case WeightCategory.WF:
|
||||
return <ImageCard {...props} />;
|
||||
default:
|
||||
return <div>Unsupported weight type</div>;
|
||||
|
||||
@@ -73,13 +73,7 @@ export default function WeightPage({
|
||||
const history = useHistory();
|
||||
const bookmarks = useBookmarks();
|
||||
const ratings = useRatings();
|
||||
const {
|
||||
data: weight,
|
||||
fetchError,
|
||||
isLoading,
|
||||
title,
|
||||
remove,
|
||||
} = useWeightFetch({
|
||||
const fetchedWeight = useWeightFetch({
|
||||
onRemove: () => {
|
||||
history.push(source || "");
|
||||
},
|
||||
@@ -89,7 +83,14 @@ export default function WeightPage({
|
||||
},
|
||||
token: weight_token,
|
||||
});
|
||||
|
||||
const {
|
||||
data: weight,
|
||||
fetchError,
|
||||
isLoading,
|
||||
title,
|
||||
remove,
|
||||
} = fetchedWeight;
|
||||
console.log(fetchedWeight);
|
||||
const timeUpdated = moment(weight?.updated_at || "").fromNow();
|
||||
const dateUpdated = moment(weight?.updated_at || "").format("LLL");
|
||||
const dateCreated = moment(weight?.created_at || "").format("LLL");
|
||||
@@ -287,6 +288,7 @@ export default function WeightPage({
|
||||
[WeightCategory.SD]: { weightCategory: "Image Generation" },
|
||||
[WeightCategory.ZS]: { weightCategory: "Voice Designer" },
|
||||
[WeightCategory.VOCODER]: { weightCategory: "Vocoder" },
|
||||
[WeightCategory.WF]: { weightCategory: "Workflow Config" },
|
||||
};
|
||||
|
||||
let { weightCategory } = weightCategoryMap[weight.weight_category] || {
|
||||
@@ -321,14 +323,11 @@ export default function WeightPage({
|
||||
|
||||
switch (weight.weight_category) {
|
||||
case WeightCategory.TTS:
|
||||
weightDetails = <DataTable data={voiceDetails} />;
|
||||
break;
|
||||
case WeightCategory.VC:
|
||||
weightDetails = <DataTable data={voiceDetails} />;
|
||||
break;
|
||||
case WeightCategory.ZS:
|
||||
weightDetails = <DataTable data={voiceDetails} />;
|
||||
break;
|
||||
case WeightCategory.WF:
|
||||
case WeightCategory.SD:
|
||||
weightDetails = <DataTable data={imageDetails} />;
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user