diff --git a/js/src/lib/interfaces/Types.ts b/js/src/lib/interfaces/Types.ts index 0db97c85d..8f923bdf3 100644 --- a/js/src/lib/interfaces/Types.ts +++ b/js/src/lib/interfaces/Types.ts @@ -749,3 +749,97 @@ 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: Record> = { + "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_sherpa": [ + "automatic-speech-recognition" + ], + "keras": [ + "image-classification" + ], + "nemo": [ + "automatic-speech-recognition" + ], + "paddlenlp": [ + "conversational", + "fill-mask" + ], + "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" + ], + "superb": [ + "automatic-speech-recognition", + "speech-segmentation" + ], + "timm": [ + "image-classification" + ] +} \ No newline at end of file