Spaces:
Runtime error
Runtime error
machineuser
commited on
Commit
•
4487afc
1
Parent(s):
7e60675
Sync widgets demo
Browse files
packages/tasks/src/index.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
export {
|
2 |
export { MAPPING_DEFAULT_WIDGET } from "./default-widget-inputs";
|
3 |
export type { TaskData, TaskDemo, TaskDemoEntry, ExampleRepo } from "./tasks";
|
4 |
export * from "./tasks";
|
|
|
1 |
+
export { LIBRARY_TASK_MAPPING } from "./library-to-tasks";
|
2 |
export { MAPPING_DEFAULT_WIDGET } from "./default-widget-inputs";
|
3 |
export type { TaskData, TaskDemo, TaskDemoEntry, ExampleRepo } from "./tasks";
|
4 |
export * from "./tasks";
|
packages/tasks/src/library-to-tasks.ts
CHANGED
@@ -2,13 +2,13 @@ import type { ModelLibraryKey } from "./model-libraries";
|
|
2 |
import type { PipelineType } from "./pipelines";
|
3 |
|
4 |
/**
|
5 |
-
* Mapping from library name
|
6 |
* Inference API (serverless) should be disabled for all other (library, task) pairs beyond this mapping.
|
7 |
-
*
|
8 |
-
*
|
9 |
-
*
|
10 |
*/
|
11 |
-
export const
|
12 |
"adapter-transformers": ["question-answering", "text-classification", "token-classification"],
|
13 |
allennlp: ["question-answering"],
|
14 |
asteroid: [
|
@@ -44,5 +44,23 @@ export const LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS: Partial<Record<ModelLi
|
|
44 |
],
|
45 |
stanza: ["token-classification"],
|
46 |
timm: ["image-classification"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
mindspore: ["image-classification"],
|
48 |
};
|
|
|
2 |
import type { PipelineType } from "./pipelines";
|
3 |
|
4 |
/**
|
5 |
+
* Mapping from library name to its supported tasks.
|
6 |
* Inference API (serverless) should be disabled for all other (library, task) pairs beyond this mapping.
|
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 |
*/
|
11 |
+
export const LIBRARY_TASK_MAPPING: Partial<Record<ModelLibraryKey, PipelineType[]>> = {
|
12 |
"adapter-transformers": ["question-answering", "text-classification", "token-classification"],
|
13 |
allennlp: ["question-answering"],
|
14 |
asteroid: [
|
|
|
44 |
],
|
45 |
stanza: ["token-classification"],
|
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 |
+
],
|
65 |
mindspore: ["image-classification"],
|
66 |
};
|