Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions js/src/lib/interfaces/LibrariesToTasks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import type { ModelLibraryKey } from "./Libraries";
import type { PipelineType } from "./Types";

/**
* Mapping from library name (excluding Transformers) to its supported tasks.
* Inference API should be disabled for all other (library, task) pairs beyond this mapping.
* As an exception, we assume Transformers supports all inference tasks.
* This mapping is generated automatically by "python-api-export-tasks" action in huggingface/api-inference-community repo upon merge.
* Ref: https://github.com/huggingface/api-inference-community/pull/158
*/
export const LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS: Partial<Record<ModelLibraryKey, PipelineType[]>> = {
"adapter-transformers": [
"question-answering",
"text-classification",
"token-classification",
],
"allennlp": [
"question-answering",
],
"asteroid": [
// "audio-source-separation",
"audio-to-audio",
],
"diffusers": [
"text-to-image",
],
"doctr": [
"object-detection",
],
"espnet": [
"text-to-speech",
"automatic-speech-recognition",
],
"fairseq": [
"text-to-speech",
"audio-to-audio",
],
"fastai": [
"image-classification",
],
"fasttext": [
"feature-extraction",
"text-classification",
],
"flair": [
"token-classification",
],
"k2": [
"automatic-speech-recognition",
],
"keras": [
"image-classification",
],
"nemo": [
"automatic-speech-recognition",
],
"paddlenlp": [
"conversational",
"fill-mask",
"summarization",
],
"pyannote-audio": [
"automatic-speech-recognition",
],
"sentence-transformers": [
"feature-extraction",
"sentence-similarity",
],
"sklearn": [
"tabular-classification",
"tabular-regression",
"text-classification",
],
"spacy": [
"token-classification",
"text-classification",
"sentence-similarity",
],
"speechbrain": [
"audio-classification",
"audio-to-audio",
"automatic-speech-recognition",
"text-to-speech",
"text2text-generation",
],
"stanza": [
"token-classification",
],
"timm": [
"image-classification",
],
};
93 changes: 0 additions & 93 deletions js/src/lib/interfaces/Types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { ModelLibraryKey } from "./Libraries";

// Warning: order of modalities here determine how they are listed on the /tasks page
export const MODALITIES = [
"cv",
Expand Down Expand Up @@ -751,94 +749,3 @@ export interface TransformersInfo {
*/
processor?: string;
}


/**
* Mapping from library name (excluding Transformers) to its supported tasks.
* Inference API should be disabled for all other (library, task) pairs beyond this mapping.
* As an exception, we assume Transformers supports all inference tasks.
* This mapping is generated automatically by "python-api-export-tasks" action in huggingface/api-inference-community repo upon merge.
* Ref: https://github.com/huggingface/api-inference-community/pull/158
*/
export const LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS: Partial<Record<ModelLibraryKey, PipelineType[]>> = {
"adapter-transformers": [
"question-answering",
"text-classification",
"token-classification",
],
"allennlp": [
"question-answering",
],
"asteroid": [
// "audio-source-separation",
"audio-to-audio",
],
"diffusers": [
"text-to-image",
],
"doctr": [
"object-detection",
],
"espnet": [
"text-to-speech",
"automatic-speech-recognition",
],
"fairseq": [
"text-to-speech",
"audio-to-audio",
],
"fastai": [
"image-classification",
],
"fasttext": [
"feature-extraction",
"text-classification",
],
"flair": [
"token-classification",
],
"k2": [
"automatic-speech-recognition",
],
"keras": [
"image-classification",
],
"nemo": [
"automatic-speech-recognition",
],
"paddlenlp": [
"conversational",
"fill-mask",
"summarization",
],
"pyannote-audio": [
"automatic-speech-recognition",
],
"sentence-transformers": [
"feature-extraction",
"sentence-similarity",
],
"sklearn": [
"tabular-classification",
"tabular-regression",
"text-classification",
],
"spacy": [
"token-classification",
"text-classification",
"sentence-similarity",
],
"speechbrain": [
"audio-classification",
"audio-to-audio",
"automatic-speech-recognition",
"text-to-speech",
"text2text-generation",
],
"stanza": [
"token-classification",
],
"timm": [
"image-classification",
],
};