@huggingface/tasks 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/index.d.ts +381 -5
- package/dist/index.js +1986 -77
- package/dist/index.mjs +1985 -76
- package/package.json +2 -4
- package/src/default-widget-inputs.ts +718 -0
- package/src/index.ts +35 -4
- package/src/library-to-tasks.ts +47 -0
- package/src/library-ui-elements.ts +765 -0
- package/src/model-data.ts +239 -0
- package/src/pipelines.ts +39 -0
- package/src/snippets/curl.ts +63 -0
- package/src/snippets/index.ts +6 -0
- package/src/snippets/inputs.ts +144 -0
- package/src/snippets/js.ts +150 -0
- package/src/snippets/python.ts +155 -0
- package/src/{audio-classification → tasks/audio-classification}/about.md +2 -1
- package/src/{audio-classification → tasks/audio-classification}/data.ts +3 -3
- package/src/{audio-to-audio → tasks/audio-to-audio}/data.ts +1 -1
- package/src/{automatic-speech-recognition → tasks/automatic-speech-recognition}/about.md +3 -2
- package/src/{automatic-speech-recognition → tasks/automatic-speech-recognition}/data.ts +6 -6
- package/src/{conversational → tasks/conversational}/data.ts +1 -1
- package/src/{depth-estimation → tasks/depth-estimation}/data.ts +1 -1
- package/src/{document-question-answering → tasks/document-question-answering}/data.ts +1 -1
- package/src/{feature-extraction → tasks/feature-extraction}/data.ts +2 -7
- package/src/{fill-mask → tasks/fill-mask}/data.ts +1 -1
- package/src/{image-classification → tasks/image-classification}/data.ts +1 -1
- package/src/{image-segmentation → tasks/image-segmentation}/data.ts +1 -1
- package/src/{image-to-image → tasks/image-to-image}/about.md +8 -7
- package/src/{image-to-image → tasks/image-to-image}/data.ts +1 -1
- package/src/{image-to-text → tasks/image-to-text}/data.ts +1 -1
- package/src/{tasksData.ts → tasks/index.ts} +144 -15
- package/src/{object-detection → tasks/object-detection}/data.ts +1 -1
- package/src/{placeholder → tasks/placeholder}/data.ts +1 -1
- package/src/{question-answering → tasks/question-answering}/data.ts +1 -1
- package/src/{reinforcement-learning → tasks/reinforcement-learning}/data.ts +1 -1
- package/src/{sentence-similarity → tasks/sentence-similarity}/data.ts +1 -1
- package/src/{summarization → tasks/summarization}/data.ts +1 -1
- package/src/{table-question-answering → tasks/table-question-answering}/data.ts +1 -1
- package/src/{tabular-classification → tasks/tabular-classification}/data.ts +1 -1
- package/src/{tabular-regression → tasks/tabular-regression}/data.ts +1 -1
- package/src/{text-classification → tasks/text-classification}/data.ts +1 -1
- package/src/{text-generation → tasks/text-generation}/about.md +13 -3
- package/src/{text-generation → tasks/text-generation}/data.ts +2 -2
- package/src/{text-to-image → tasks/text-to-image}/data.ts +1 -1
- package/src/{text-to-speech → tasks/text-to-speech}/about.md +2 -1
- package/src/{text-to-speech → tasks/text-to-speech}/data.ts +4 -4
- package/src/{text-to-video → tasks/text-to-video}/data.ts +1 -1
- package/src/{token-classification → tasks/token-classification}/data.ts +1 -1
- package/src/{translation → tasks/translation}/data.ts +1 -1
- package/src/{unconditional-image-generation → tasks/unconditional-image-generation}/data.ts +1 -1
- package/src/{video-classification → tasks/video-classification}/about.md +8 -28
- package/src/{video-classification → tasks/video-classification}/data.ts +1 -1
- package/src/{visual-question-answering → tasks/visual-question-answering}/data.ts +1 -1
- package/src/{zero-shot-classification → tasks/zero-shot-classification}/data.ts +1 -1
- package/src/{zero-shot-image-classification → tasks/zero-shot-image-classification}/data.ts +1 -1
- package/src/Types.ts +0 -64
- package/src/const.ts +0 -59
- /package/src/{modelLibraries.ts → model-libraries.ts} +0 -0
- /package/src/{audio-to-audio → tasks/audio-to-audio}/about.md +0 -0
- /package/src/{conversational → tasks/conversational}/about.md +0 -0
- /package/src/{depth-estimation → tasks/depth-estimation}/about.md +0 -0
- /package/src/{document-question-answering → tasks/document-question-answering}/about.md +0 -0
- /package/src/{feature-extraction → tasks/feature-extraction}/about.md +0 -0
- /package/src/{fill-mask → tasks/fill-mask}/about.md +0 -0
- /package/src/{image-classification → tasks/image-classification}/about.md +0 -0
- /package/src/{image-segmentation → tasks/image-segmentation}/about.md +0 -0
- /package/src/{image-to-text → tasks/image-to-text}/about.md +0 -0
- /package/src/{object-detection → tasks/object-detection}/about.md +0 -0
- /package/src/{placeholder → tasks/placeholder}/about.md +0 -0
- /package/src/{question-answering → tasks/question-answering}/about.md +0 -0
- /package/src/{reinforcement-learning → tasks/reinforcement-learning}/about.md +0 -0
- /package/src/{sentence-similarity → tasks/sentence-similarity}/about.md +0 -0
- /package/src/{summarization → tasks/summarization}/about.md +0 -0
- /package/src/{table-question-answering → tasks/table-question-answering}/about.md +0 -0
- /package/src/{tabular-classification → tasks/tabular-classification}/about.md +0 -0
- /package/src/{tabular-regression → tasks/tabular-regression}/about.md +0 -0
- /package/src/{text-classification → tasks/text-classification}/about.md +0 -0
- /package/src/{text-to-image → tasks/text-to-image}/about.md +0 -0
- /package/src/{text-to-video → tasks/text-to-video}/about.md +0 -0
- /package/src/{token-classification → tasks/token-classification}/about.md +0 -0
- /package/src/{translation → tasks/translation}/about.md +0 -0
- /package/src/{unconditional-image-generation → tasks/unconditional-image-generation}/about.md +0 -0
- /package/src/{visual-question-answering → tasks/visual-question-answering}/about.md +0 -0
- /package/src/{zero-shot-classification → tasks/zero-shot-classification}/about.md +0 -0
- /package/src/{zero-shot-image-classification → tasks/zero-shot-image-classification}/about.md +0 -0
package/src/index.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {
|
|
1
|
+
export { LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS } from "./library-to-tasks";
|
|
2
|
+
export { MODEL_LIBRARIES_UI_ELEMENTS } from "./library-ui-elements";
|
|
3
|
+
export { MAPPING_DEFAULT_WIDGET } from "./default-widget-inputs";
|
|
4
|
+
export type { TaskData, TaskDemo, TaskDemoEntry, ExampleRepo } from "./tasks";
|
|
5
|
+
export * from "./tasks";
|
|
3
6
|
export {
|
|
4
7
|
PIPELINE_DATA,
|
|
5
8
|
PIPELINE_TYPES,
|
|
@@ -11,7 +14,35 @@ export {
|
|
|
11
14
|
SUBTASK_TYPES,
|
|
12
15
|
PIPELINE_TYPES_SET,
|
|
13
16
|
} from "./pipelines";
|
|
14
|
-
export { ModelLibrary, ALL_DISPLAY_MODEL_LIBRARY_KEYS } from "./
|
|
15
|
-
export type { ModelLibraryKey } from "./
|
|
17
|
+
export { ModelLibrary, ALL_DISPLAY_MODEL_LIBRARY_KEYS } from "./model-libraries";
|
|
18
|
+
export type { ModelLibraryKey } from "./model-libraries";
|
|
19
|
+
export {
|
|
20
|
+
ModelData,
|
|
21
|
+
TransformersInfo,
|
|
22
|
+
WidgetExample,
|
|
23
|
+
WidgetExampleAttribute,
|
|
24
|
+
WidgetExampleAssetAndPromptInput,
|
|
25
|
+
WidgetExampleAssetAndTextInput,
|
|
26
|
+
WidgetExampleAssetAndZeroShotInput,
|
|
27
|
+
WidgetExampleAssetInput,
|
|
28
|
+
WidgetExampleSentenceSimilarityInput,
|
|
29
|
+
WidgetExampleStructuredDataInput,
|
|
30
|
+
WidgetExampleTableDataInput,
|
|
31
|
+
WidgetExampleTextAndContextInput,
|
|
32
|
+
WidgetExampleTextAndTableInput,
|
|
33
|
+
WidgetExampleTextInput,
|
|
34
|
+
WidgetExampleZeroShotTextInput,
|
|
35
|
+
WidgetExampleOutput,
|
|
36
|
+
WidgetExampleOutputUrl,
|
|
37
|
+
WidgetExampleOutputLabels,
|
|
38
|
+
WidgetExampleOutputAnswerScore,
|
|
39
|
+
WidgetExampleOutputText,
|
|
40
|
+
} from "./model-data";
|
|
41
|
+
export { InferenceDisplayability } from "./model-data";
|
|
16
42
|
|
|
17
43
|
export { TAG_NFAA_CONTENT, OTHER_TAGS_SUGGESTIONS, TAG_TEXT_GENERATION_INFERENCE, TAG_CUSTOM_CODE } from "./tags";
|
|
44
|
+
|
|
45
|
+
import * as snippets from "./snippets";
|
|
46
|
+
export { snippets };
|
|
47
|
+
|
|
48
|
+
export type { LibraryUiElement } from "./library-ui-elements";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ModelLibraryKey } from "./model-libraries";
|
|
2
|
+
import type { PipelineType } from "./pipelines";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Mapping from library name (excluding Transformers) to its supported tasks.
|
|
6
|
+
* Inference API 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
|
|
10
|
+
*/
|
|
11
|
+
export const LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS: Partial<Record<ModelLibraryKey, PipelineType[]>> = {
|
|
12
|
+
"adapter-transformers": ["question-answering", "text-classification", "token-classification"],
|
|
13
|
+
allennlp: ["question-answering"],
|
|
14
|
+
asteroid: [
|
|
15
|
+
// "audio-source-separation",
|
|
16
|
+
"audio-to-audio",
|
|
17
|
+
],
|
|
18
|
+
bertopic: ["text-classification"],
|
|
19
|
+
diffusers: ["image-to-image", "text-to-image"],
|
|
20
|
+
doctr: ["object-detection"],
|
|
21
|
+
espnet: ["text-to-speech", "automatic-speech-recognition"],
|
|
22
|
+
fairseq: ["text-to-speech", "audio-to-audio"],
|
|
23
|
+
fastai: ["image-classification"],
|
|
24
|
+
fasttext: ["feature-extraction", "text-classification"],
|
|
25
|
+
flair: ["token-classification"],
|
|
26
|
+
k2: ["automatic-speech-recognition"],
|
|
27
|
+
keras: ["image-classification"],
|
|
28
|
+
nemo: ["automatic-speech-recognition"],
|
|
29
|
+
open_clip: ["zero-shot-classification", "zero-shot-image-classification"],
|
|
30
|
+
paddlenlp: ["conversational", "fill-mask", "summarization", "zero-shot-classification"],
|
|
31
|
+
peft: ["text-generation"],
|
|
32
|
+
"pyannote-audio": ["automatic-speech-recognition"],
|
|
33
|
+
"sentence-transformers": ["feature-extraction", "sentence-similarity"],
|
|
34
|
+
sklearn: ["tabular-classification", "tabular-regression", "text-classification"],
|
|
35
|
+
spacy: ["token-classification", "text-classification", "sentence-similarity"],
|
|
36
|
+
"span-marker": ["token-classification"],
|
|
37
|
+
speechbrain: [
|
|
38
|
+
"audio-classification",
|
|
39
|
+
"audio-to-audio",
|
|
40
|
+
"automatic-speech-recognition",
|
|
41
|
+
"text-to-speech",
|
|
42
|
+
"text2text-generation",
|
|
43
|
+
],
|
|
44
|
+
stanza: ["token-classification"],
|
|
45
|
+
timm: ["image-classification"],
|
|
46
|
+
mindspore: ["image-classification"],
|
|
47
|
+
};
|