Skip to content

Commit

Permalink
Add any-to-any as a task to Hub (#860)
Browse files Browse the repository at this point in the history
This PR adds any-to-any for tasks that have 2+ inputs to 2+ outputs like
4M, Chameleon, Lumina-mGPT etc
  • Loading branch information
merveenoyan committed Sep 4, 2024
1 parent a9047d5 commit 6e12cfa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/tasks/src/pipelines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions packages/tasks/src/tasks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export const TASKS_MODEL_LIBRARIES: Record<PipelineType, ModelLibraryKey[]> = {
"zero-shot-object-detection": ["transformers", "transformers.js"],
"text-to-3d": ["diffusers"],
"image-to-3d": ["diffusers"],
"any-to-any": ["transformers"],
};

/**
Expand All @@ -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<PipelineType, TaskData | undefined> = {
"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),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32" {...$$props}><path fill="currentColor" d="M10 15h12v2H10zM8.7 6.285A3 3 0 0 0 9 5a3 3 0 1 0-3 3a2.96 2.96 0 0 0 1.285-.3L10 10.413V13h2V9.586zM6 6a1 1 0 1 1 1-1a1 1 0 0 1-1 1m13-1a3 3 0 1 0-4 2.815V13h2V7.816A3 3 0 0 0 19 5m-3 1a1 1 0 1 1 1-1a1 1 0 0 1-1 1m10-4a3.003 3.003 0 0 0-3 3a3 3 0 0 0 .3 1.285l-3.3 3.3V13h2v-2.586L24.715 7.7A2.96 2.96 0 0 0 26 8a3 3 0 0 0 0-6m0 4a1 1 0 1 1 1-1a1 1 0 0 1-1 1M12 19h-2v2.586L7.285 24.3A2.96 2.96 0 0 0 6 24a3 3 0 1 0 3 3a3 3 0 0 0-.3-1.285l3.3-3.3zm-6 9a1 1 0 1 1 1-1a1 1 0 0 1-1 1m11-3.816V19h-2v5.184a3 3 0 1 0 2 0M16 28a1 1 0 1 1 1-1a1 1 0 0 1-1 1m10-4a2.96 2.96 0 0 0-1.285.3L22 21.587V19h-2v3.414l3.3 3.3A3 3 0 0 0 23 27a3 3 0 1 0 3-3m0 4a1 1 0 1 1 1-1a1 1 0 0 1-1 1"/></svg>
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -97,6 +98,7 @@
"image-to-3d": IconImageTo3D,
"image-feature-extraction": IconImageFeatureExtraction,
"video-text-to-text": IconVideoTextToText,
"any-to-any": IconAnyToAny,
"keypoint-detection": IconKeypointDetection,
};
Expand Down

0 comments on commit 6e12cfa

Please sign in to comment.