From 6e12cfae0a4535467290b9b6b045282b5a91cd8a Mon Sep 17 00:00:00 2001 From: Merve Noyan Date: Wed, 4 Sep 2024 11:15:53 +0300 Subject: [PATCH] Add any-to-any as a task to Hub (#860) This PR adds any-to-any for tasks that have 2+ inputs to 2+ outputs like 4M, Chameleon, Lumina-mGPT etc --- packages/tasks/src/pipelines.ts | 6 ++++++ packages/tasks/src/tasks/index.ts | 2 ++ .../widgets/src/lib/components/Icons/IconAnyToAny.svelte | 1 + .../src/lib/components/PipelineIcon/PipelineIcon.svelte | 2 ++ 4 files changed, 11 insertions(+) create mode 100644 packages/widgets/src/lib/components/Icons/IconAnyToAny.svelte diff --git a/packages/tasks/src/pipelines.ts b/packages/tasks/src/pipelines.ts index 7edc61605..34907f064 100644 --- a/packages/tasks/src/pipelines.ts +++ b/packages/tasks/src/pipelines.ts @@ -670,6 +670,12 @@ export const PIPELINE_DATA = { color: "red", hideInDatasets: true, }, + "any-to-any": { + name: "Any-to-Any", + modality: "multimodal", + color: "yellow", + hideInDatasets: true, + }, other: { name: "Other", modality: "other", diff --git a/packages/tasks/src/tasks/index.ts b/packages/tasks/src/tasks/index.ts index a72bb9c88..6c8068680 100644 --- a/packages/tasks/src/tasks/index.ts +++ b/packages/tasks/src/tasks/index.ts @@ -170,6 +170,7 @@ export const TASKS_MODEL_LIBRARIES: Record = { "zero-shot-object-detection": ["transformers", "transformers.js"], "text-to-3d": ["diffusers"], "image-to-3d": ["diffusers"], + "any-to-any": ["transformers"], }; /** @@ -191,6 +192,7 @@ function getData(type: PipelineType, partialTaskData: TaskDataCustom = placehold // Tasks that call getData() without the second argument will // have a "placeholder" page. export const TASKS_DATA: Record = { + "any-to-any": getData("any-to-any", placeholder), "audio-classification": getData("audio-classification", audioClassification), "audio-to-audio": getData("audio-to-audio", audioToAudio), "automatic-speech-recognition": getData("automatic-speech-recognition", automaticSpeechRecognition), diff --git a/packages/widgets/src/lib/components/Icons/IconAnyToAny.svelte b/packages/widgets/src/lib/components/Icons/IconAnyToAny.svelte new file mode 100644 index 000000000..9ebbf1b8c --- /dev/null +++ b/packages/widgets/src/lib/components/Icons/IconAnyToAny.svelte @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/widgets/src/lib/components/PipelineIcon/PipelineIcon.svelte b/packages/widgets/src/lib/components/PipelineIcon/PipelineIcon.svelte index 02cb84f27..1429e1cb4 100644 --- a/packages/widgets/src/lib/components/PipelineIcon/PipelineIcon.svelte +++ b/packages/widgets/src/lib/components/PipelineIcon/PipelineIcon.svelte @@ -43,6 +43,7 @@ import IconImageTo3D from "../Icons/IconImageTo3D.svelte"; import IconImageFeatureExtraction from "../Icons/IconImageFeatureExtraction.svelte"; import IconVideoTextToText from "../Icons/IconVideoTextToText.svelte"; + import IconAnyToAny from "../Icons/IconAnyToAny.svelte"; import IconKeypointDetection from "../Icons/IconKeypointDetection.svelte"; import type { WidgetType } from "@huggingface/tasks"; @@ -97,6 +98,7 @@ "image-to-3d": IconImageTo3D, "image-feature-extraction": IconImageFeatureExtraction, "video-text-to-text": IconVideoTextToText, + "any-to-any": IconAnyToAny, "keypoint-detection": IconKeypointDetection, };