@@ -2,13 +2,13 @@ import type { ModelLibraryKey } from "./model-libraries";
2
2
import type { PipelineType } from "./pipelines" ;
3
3
4
4
/**
5
- * Mapping from library name (excluding Transformers) to its supported tasks.
5
+ * Mapping from library name to its supported tasks.
6
6
* Inference API (serverless) should be disabled for all other (library, task) pairs beyond this mapping.
7
- * As an exception, we assume Transformers supports all inference tasks.
8
- * This mapping is generated automatically by "python-api-export-tasks" action in huggingface/api-inference-community repo upon merge.
9
- * Ref: https://github.com/huggingface/ api-inference-community/pull/158
7
+ * This mapping is partially generated automatically by "python-api-export-tasks" action in
8
+ * huggingface/api-inference-community repo upon merge. For transformers, the mapping is manually
9
+ * based on api-inference.
10
10
*/
11
- export const LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS : Partial < Record < ModelLibraryKey , PipelineType [ ] > > = {
11
+ export const LIBRARY_TASK_MAPPING : Partial < Record < ModelLibraryKey , PipelineType [ ] > > = {
12
12
"adapter-transformers" : [ "question-answering" , "text-classification" , "token-classification" ] ,
13
13
allennlp : [ "question-answering" ] ,
14
14
asteroid : [
@@ -44,5 +44,23 @@ export const LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS: Partial<Record<ModelLi
44
44
] ,
45
45
stanza : [ "token-classification" ] ,
46
46
timm : [ "image-classification" ] ,
47
+ transformers : [
48
+ "audio-classification" ,
49
+ "automatic-speech-recognition" ,
50
+ "depth-estimation" ,
51
+ "document-question-answering" ,
52
+ "fill-mask" ,
53
+ "image-classification" ,
54
+ "image-segmentation" ,
55
+ "image-to-text" ,
56
+ "image-to-image" ,
57
+ "object-detection" ,
58
+ "question-answering" ,
59
+ "text-generation" ,
60
+ "text2text-generation" ,
61
+ "visual-question-answering" ,
62
+ "zero-shot-classification" ,
63
+ "zero-shot-image-classification" ,
64
+ ] ,
47
65
mindspore : [ "image-classification" ] ,
48
66
} ;
0 commit comments