@huggingface/tasks 0.2.1 → 0.3.0
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 +1 -1
- package/dist/{index.mjs → index.cjs} +2695 -2497
- package/dist/index.d.ts +427 -65
- package/dist/index.js +2660 -2532
- package/package.json +13 -8
- package/src/index.ts +2 -5
- package/src/library-to-tasks.ts +1 -1
- package/src/model-data.ts +1 -1
- package/src/model-libraries-downloads.ts +20 -0
- package/src/{library-ui-elements.ts → model-libraries-snippets.ts} +50 -296
- package/src/model-libraries.ts +375 -44
- package/src/pipelines.ts +1 -1
- package/src/tasks/audio-classification/about.md +1 -1
- package/src/tasks/audio-classification/inference.ts +51 -0
- package/src/tasks/audio-classification/spec/input.json +34 -0
- package/src/tasks/audio-classification/spec/output.json +10 -0
- package/src/tasks/audio-to-audio/about.md +1 -1
- package/src/tasks/automatic-speech-recognition/about.md +4 -2
- package/src/tasks/automatic-speech-recognition/inference.ts +159 -0
- package/src/tasks/automatic-speech-recognition/spec/input.json +34 -0
- package/src/tasks/automatic-speech-recognition/spec/output.json +38 -0
- package/src/tasks/common-definitions.json +117 -0
- package/src/tasks/depth-estimation/data.ts +8 -4
- package/src/tasks/depth-estimation/inference.ts +35 -0
- package/src/tasks/depth-estimation/spec/input.json +25 -0
- package/src/tasks/depth-estimation/spec/output.json +16 -0
- package/src/tasks/document-question-answering/inference.ts +110 -0
- package/src/tasks/document-question-answering/spec/input.json +85 -0
- package/src/tasks/document-question-answering/spec/output.json +36 -0
- package/src/tasks/feature-extraction/inference.ts +22 -0
- package/src/tasks/feature-extraction/spec/input.json +26 -0
- package/src/tasks/feature-extraction/spec/output.json +7 -0
- package/src/tasks/fill-mask/inference.ts +62 -0
- package/src/tasks/fill-mask/spec/input.json +38 -0
- package/src/tasks/fill-mask/spec/output.json +29 -0
- package/src/tasks/image-classification/inference.ts +51 -0
- package/src/tasks/image-classification/spec/input.json +34 -0
- package/src/tasks/image-classification/spec/output.json +10 -0
- package/src/tasks/image-segmentation/inference.ts +65 -0
- package/src/tasks/image-segmentation/spec/input.json +54 -0
- package/src/tasks/image-segmentation/spec/output.json +25 -0
- package/src/tasks/image-to-image/inference.ts +67 -0
- package/src/tasks/image-to-image/spec/input.json +54 -0
- package/src/tasks/image-to-image/spec/output.json +12 -0
- package/src/tasks/image-to-text/inference.ts +143 -0
- package/src/tasks/image-to-text/spec/input.json +34 -0
- package/src/tasks/image-to-text/spec/output.json +14 -0
- package/src/tasks/index.ts +5 -2
- package/src/tasks/mask-generation/about.md +65 -0
- package/src/tasks/mask-generation/data.ts +42 -5
- package/src/tasks/object-detection/inference.ts +62 -0
- package/src/tasks/object-detection/spec/input.json +30 -0
- package/src/tasks/object-detection/spec/output.json +46 -0
- package/src/tasks/placeholder/data.ts +3 -0
- package/src/tasks/placeholder/spec/input.json +35 -0
- package/src/tasks/placeholder/spec/output.json +17 -0
- package/src/tasks/question-answering/inference.ts +99 -0
- package/src/tasks/question-answering/spec/input.json +67 -0
- package/src/tasks/question-answering/spec/output.json +29 -0
- package/src/tasks/sentence-similarity/about.md +2 -2
- package/src/tasks/sentence-similarity/inference.ts +32 -0
- package/src/tasks/sentence-similarity/spec/input.json +40 -0
- package/src/tasks/sentence-similarity/spec/output.json +12 -0
- package/src/tasks/summarization/data.ts +1 -0
- package/src/tasks/summarization/inference.ts +59 -0
- package/src/tasks/summarization/spec/input.json +7 -0
- package/src/tasks/summarization/spec/output.json +7 -0
- package/src/tasks/table-question-answering/inference.ts +61 -0
- package/src/tasks/table-question-answering/spec/input.json +44 -0
- package/src/tasks/table-question-answering/spec/output.json +40 -0
- package/src/tasks/tabular-classification/about.md +1 -1
- package/src/tasks/tabular-regression/about.md +1 -1
- package/src/tasks/text-classification/about.md +1 -0
- package/src/tasks/text-classification/inference.ts +51 -0
- package/src/tasks/text-classification/spec/input.json +35 -0
- package/src/tasks/text-classification/spec/output.json +10 -0
- package/src/tasks/text-generation/about.md +24 -13
- package/src/tasks/text-generation/data.ts +22 -38
- package/src/tasks/text-generation/inference.ts +194 -0
- package/src/tasks/text-generation/spec/input.json +90 -0
- package/src/tasks/text-generation/spec/output.json +120 -0
- package/src/tasks/text-to-audio/inference.ts +143 -0
- package/src/tasks/text-to-audio/spec/input.json +31 -0
- package/src/tasks/text-to-audio/spec/output.json +17 -0
- package/src/tasks/text-to-image/about.md +11 -2
- package/src/tasks/text-to-image/data.ts +6 -2
- package/src/tasks/text-to-image/inference.ts +71 -0
- package/src/tasks/text-to-image/spec/input.json +59 -0
- package/src/tasks/text-to-image/spec/output.json +13 -0
- package/src/tasks/text-to-speech/about.md +4 -2
- package/src/tasks/text-to-speech/data.ts +1 -0
- package/src/tasks/text-to-speech/inference.ts +147 -0
- package/src/tasks/text-to-speech/spec/input.json +7 -0
- package/src/tasks/text-to-speech/spec/output.json +7 -0
- package/src/tasks/text2text-generation/inference.ts +55 -0
- package/src/tasks/text2text-generation/spec/input.json +55 -0
- package/src/tasks/text2text-generation/spec/output.json +14 -0
- package/src/tasks/token-classification/inference.ts +82 -0
- package/src/tasks/token-classification/spec/input.json +65 -0
- package/src/tasks/token-classification/spec/output.json +33 -0
- package/src/tasks/translation/data.ts +1 -0
- package/src/tasks/translation/inference.ts +59 -0
- package/src/tasks/translation/spec/input.json +7 -0
- package/src/tasks/translation/spec/output.json +7 -0
- package/src/tasks/video-classification/inference.ts +59 -0
- package/src/tasks/video-classification/spec/input.json +42 -0
- package/src/tasks/video-classification/spec/output.json +10 -0
- package/src/tasks/visual-question-answering/inference.ts +63 -0
- package/src/tasks/visual-question-answering/spec/input.json +41 -0
- package/src/tasks/visual-question-answering/spec/output.json +21 -0
- package/src/tasks/zero-shot-classification/inference.ts +67 -0
- package/src/tasks/zero-shot-classification/spec/input.json +50 -0
- package/src/tasks/zero-shot-classification/spec/output.json +10 -0
- package/src/tasks/zero-shot-image-classification/data.ts +8 -5
- package/src/tasks/zero-shot-image-classification/inference.ts +61 -0
- package/src/tasks/zero-shot-image-classification/spec/input.json +45 -0
- package/src/tasks/zero-shot-image-classification/spec/output.json +10 -0
- package/src/tasks/zero-shot-object-detection/about.md +6 -0
- package/src/tasks/zero-shot-object-detection/data.ts +6 -1
- package/src/tasks/zero-shot-object-detection/inference.ts +66 -0
- package/src/tasks/zero-shot-object-detection/spec/input.json +40 -0
- package/src/tasks/zero-shot-object-detection/spec/output.json +47 -0
- package/tsconfig.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,50 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Add your new library here.
|
|
3
|
-
*
|
|
4
|
-
* This is for modeling (= architectures) libraries, not for file formats (like ONNX, etc).
|
|
5
|
-
* File formats live in an enum inside the internal codebase.
|
|
6
|
-
*/
|
|
7
|
-
declare enum ModelLibrary {
|
|
8
|
-
"adapter-transformers" = "Adapter Transformers",
|
|
9
|
-
"allennlp" = "allenNLP",
|
|
10
|
-
"asteroid" = "Asteroid",
|
|
11
|
-
"bertopic" = "BERTopic",
|
|
12
|
-
"diffusers" = "Diffusers",
|
|
13
|
-
"doctr" = "docTR",
|
|
14
|
-
"espnet" = "ESPnet",
|
|
15
|
-
"fairseq" = "Fairseq",
|
|
16
|
-
"flair" = "Flair",
|
|
17
|
-
"keras" = "Keras",
|
|
18
|
-
"k2" = "K2",
|
|
19
|
-
"mlx" = "MLX",
|
|
20
|
-
"nemo" = "NeMo",
|
|
21
|
-
"open_clip" = "OpenCLIP",
|
|
22
|
-
"paddlenlp" = "PaddleNLP",
|
|
23
|
-
"peft" = "PEFT",
|
|
24
|
-
"pyannote-audio" = "pyannote.audio",
|
|
25
|
-
"sample-factory" = "Sample Factory",
|
|
26
|
-
"sentence-transformers" = "Sentence Transformers",
|
|
27
|
-
"setfit" = "SetFit",
|
|
28
|
-
"sklearn" = "Scikit-learn",
|
|
29
|
-
"spacy" = "spaCy",
|
|
30
|
-
"span-marker" = "SpanMarker",
|
|
31
|
-
"speechbrain" = "speechbrain",
|
|
32
|
-
"tensorflowtts" = "TensorFlowTTS",
|
|
33
|
-
"timm" = "Timm",
|
|
34
|
-
"fastai" = "fastai",
|
|
35
|
-
"transformers" = "Transformers",
|
|
36
|
-
"transformers.js" = "Transformers.js",
|
|
37
|
-
"stanza" = "Stanza",
|
|
38
|
-
"fasttext" = "fastText",
|
|
39
|
-
"stable-baselines3" = "Stable-Baselines3",
|
|
40
|
-
"ml-agents" = "Unity ML-Agents",
|
|
41
|
-
"pythae" = "Pythae",
|
|
42
|
-
"mindspore" = "MindSpore",
|
|
43
|
-
"unity-sentis" = "Unity Sentis"
|
|
44
|
-
}
|
|
45
|
-
type ModelLibraryKey = keyof typeof ModelLibrary;
|
|
46
|
-
declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("speechbrain" | "fastai" | "adapter-transformers" | "allennlp" | "asteroid" | "bertopic" | "diffusers" | "doctr" | "espnet" | "fairseq" | "flair" | "keras" | "k2" | "mlx" | "nemo" | "open_clip" | "paddlenlp" | "peft" | "pyannote-audio" | "sample-factory" | "sentence-transformers" | "setfit" | "sklearn" | "spacy" | "span-marker" | "tensorflowtts" | "timm" | "transformers" | "transformers.js" | "stanza" | "fasttext" | "stable-baselines3" | "ml-agents" | "pythae" | "mindspore" | "unity-sentis")[];
|
|
47
|
-
|
|
48
1
|
declare const MODALITIES: readonly ["cv", "nlp", "audio", "tabular", "multimodal", "rl", "other"];
|
|
49
2
|
type Modality = (typeof MODALITIES)[number];
|
|
50
3
|
declare const MODALITY_LABELS: {
|
|
@@ -446,15 +399,6 @@ declare const PIPELINE_TYPES: ("other" | "text-classification" | "token-classifi
|
|
|
446
399
|
declare const SUBTASK_TYPES: string[];
|
|
447
400
|
declare const PIPELINE_TYPES_SET: Set<"other" | "text-classification" | "token-classification" | "table-question-answering" | "question-answering" | "zero-shot-classification" | "translation" | "summarization" | "conversational" | "feature-extraction" | "text-generation" | "text2text-generation" | "fill-mask" | "sentence-similarity" | "text-to-speech" | "text-to-audio" | "automatic-speech-recognition" | "audio-to-audio" | "audio-classification" | "voice-activity-detection" | "depth-estimation" | "image-classification" | "object-detection" | "image-segmentation" | "text-to-image" | "image-to-text" | "image-to-image" | "image-to-video" | "unconditional-image-generation" | "video-classification" | "reinforcement-learning" | "robotics" | "tabular-classification" | "tabular-regression" | "tabular-to-text" | "table-to-text" | "multiple-choice" | "text-retrieval" | "time-series-forecasting" | "text-to-video" | "visual-question-answering" | "document-question-answering" | "zero-shot-image-classification" | "graph-ml" | "mask-generation" | "zero-shot-object-detection" | "text-to-3d" | "image-to-3d">;
|
|
448
401
|
|
|
449
|
-
/**
|
|
450
|
-
* Mapping from library name (excluding Transformers) to its supported tasks.
|
|
451
|
-
* Inference API should be disabled for all other (library, task) pairs beyond this mapping.
|
|
452
|
-
* As an exception, we assume Transformers supports all inference tasks.
|
|
453
|
-
* This mapping is generated automatically by "python-api-export-tasks" action in huggingface/api-inference-community repo upon merge.
|
|
454
|
-
* Ref: https://github.com/huggingface/api-inference-community/pull/158
|
|
455
|
-
*/
|
|
456
|
-
declare const LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS: Partial<Record<ModelLibraryKey, PipelineType[]>>;
|
|
457
|
-
|
|
458
402
|
/**
|
|
459
403
|
* See default-widget-inputs.ts for the default widget inputs, this files only contains the types
|
|
460
404
|
*/
|
|
@@ -612,7 +556,7 @@ interface ModelData {
|
|
|
612
556
|
*/
|
|
613
557
|
widgetData?: WidgetExample[] | undefined;
|
|
614
558
|
/**
|
|
615
|
-
* Parameters that will be used by the widget when calling Inference
|
|
559
|
+
* Parameters that will be used by the widget when calling Inference Endpoints (serverless)
|
|
616
560
|
* https://huggingface.co/docs/api-inference/detailed_parameters
|
|
617
561
|
*
|
|
618
562
|
* can be set in the model card metadata (under `inference/parameters`)
|
|
@@ -655,21 +599,48 @@ interface TransformersInfo {
|
|
|
655
599
|
processor?: string;
|
|
656
600
|
}
|
|
657
601
|
|
|
602
|
+
/**
|
|
603
|
+
* This file contains the (simplified) types used
|
|
604
|
+
* to represent queries that are made to Elastic
|
|
605
|
+
* in order to count number of model downloads
|
|
606
|
+
*
|
|
607
|
+
* Read this doc about download stats on the Hub:
|
|
608
|
+
*
|
|
609
|
+
* https://huggingface.co/docs/hub/models-download-stats
|
|
610
|
+
*
|
|
611
|
+
* see also:
|
|
612
|
+
* https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html
|
|
613
|
+
*/
|
|
614
|
+
type ElasticBoolQueryFilter = {
|
|
615
|
+
term?: {
|
|
616
|
+
path: string;
|
|
617
|
+
};
|
|
618
|
+
} | {
|
|
619
|
+
terms?: {
|
|
620
|
+
path: string[];
|
|
621
|
+
};
|
|
622
|
+
} | {
|
|
623
|
+
wildcard?: {
|
|
624
|
+
path: string;
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
|
|
658
628
|
/**
|
|
659
629
|
* Elements configurable by a model library.
|
|
660
630
|
*/
|
|
661
631
|
interface LibraryUiElement {
|
|
662
632
|
/**
|
|
663
|
-
*
|
|
633
|
+
* Pretty name of the library.
|
|
634
|
+
* displayed in tags, and on the main
|
|
664
635
|
* call-to-action button on the model page.
|
|
665
636
|
*/
|
|
666
|
-
|
|
637
|
+
prettyLabel: string;
|
|
667
638
|
/**
|
|
668
|
-
* Repo name
|
|
639
|
+
* Repo name of the library's (usually on GitHub) code repo
|
|
669
640
|
*/
|
|
670
641
|
repoName: string;
|
|
671
642
|
/**
|
|
672
|
-
* URL to library's repo
|
|
643
|
+
* URL to library's (usually on GitHub) code repo
|
|
673
644
|
*/
|
|
674
645
|
repoUrl: string;
|
|
675
646
|
/**
|
|
@@ -677,11 +648,401 @@ interface LibraryUiElement {
|
|
|
677
648
|
*/
|
|
678
649
|
docsUrl?: string;
|
|
679
650
|
/**
|
|
680
|
-
* Code snippet displayed on model page
|
|
651
|
+
* Code snippet(s) displayed on model page
|
|
652
|
+
*/
|
|
653
|
+
snippets?: (model: ModelData) => string[];
|
|
654
|
+
/**
|
|
655
|
+
* Elastic query used to count this library's model downloads
|
|
656
|
+
*
|
|
657
|
+
* By default, those files are counted:
|
|
658
|
+
* "config.json", "config.yaml", "hyperparams.yaml", "meta.yaml"
|
|
681
659
|
*/
|
|
682
|
-
|
|
660
|
+
countDownloads?: ElasticBoolQueryFilter;
|
|
661
|
+
/**
|
|
662
|
+
* should we display this library in hf.co/models filter
|
|
663
|
+
* (only for popular libraries with > 100 models)
|
|
664
|
+
*/
|
|
665
|
+
filter?: boolean;
|
|
683
666
|
}
|
|
684
|
-
|
|
667
|
+
/**
|
|
668
|
+
* Add your new library here.
|
|
669
|
+
*
|
|
670
|
+
* This is for modeling (= architectures) libraries, not for file formats (like ONNX, etc).
|
|
671
|
+
* (unlike libraries, file formats live in an enum inside the internal codebase.)
|
|
672
|
+
*
|
|
673
|
+
* Doc on how to add a library to the Hub:
|
|
674
|
+
*
|
|
675
|
+
* https://huggingface.co/docs/hub/models-adding-libraries
|
|
676
|
+
*
|
|
677
|
+
* /!\ IMPORTANT
|
|
678
|
+
*
|
|
679
|
+
* The key you choose is the tag your models have in their library_name on the Hub.
|
|
680
|
+
*/
|
|
681
|
+
declare const MODEL_LIBRARIES_UI_ELEMENTS: {
|
|
682
|
+
"adapter-transformers": {
|
|
683
|
+
prettyLabel: string;
|
|
684
|
+
repoName: string;
|
|
685
|
+
repoUrl: string;
|
|
686
|
+
docsUrl: string;
|
|
687
|
+
snippets: (model: ModelData) => string[];
|
|
688
|
+
filter: true;
|
|
689
|
+
countDownloads: {
|
|
690
|
+
term: {
|
|
691
|
+
path: string;
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
allennlp: {
|
|
696
|
+
prettyLabel: string;
|
|
697
|
+
repoName: string;
|
|
698
|
+
repoUrl: string;
|
|
699
|
+
docsUrl: string;
|
|
700
|
+
snippets: (model: ModelData) => string[];
|
|
701
|
+
filter: true;
|
|
702
|
+
};
|
|
703
|
+
asteroid: {
|
|
704
|
+
prettyLabel: string;
|
|
705
|
+
repoName: string;
|
|
706
|
+
repoUrl: string;
|
|
707
|
+
docsUrl: string;
|
|
708
|
+
snippets: (model: ModelData) => string[];
|
|
709
|
+
filter: true;
|
|
710
|
+
countDownloads: {
|
|
711
|
+
term: {
|
|
712
|
+
path: string;
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
};
|
|
716
|
+
bertopic: {
|
|
717
|
+
prettyLabel: string;
|
|
718
|
+
repoName: string;
|
|
719
|
+
repoUrl: string;
|
|
720
|
+
snippets: (model: ModelData) => string[];
|
|
721
|
+
filter: true;
|
|
722
|
+
};
|
|
723
|
+
diffusers: {
|
|
724
|
+
prettyLabel: string;
|
|
725
|
+
repoName: string;
|
|
726
|
+
repoUrl: string;
|
|
727
|
+
docsUrl: string;
|
|
728
|
+
snippets: (model: ModelData) => string[];
|
|
729
|
+
filter: true;
|
|
730
|
+
};
|
|
731
|
+
doctr: {
|
|
732
|
+
prettyLabel: string;
|
|
733
|
+
repoName: string;
|
|
734
|
+
repoUrl: string;
|
|
735
|
+
};
|
|
736
|
+
espnet: {
|
|
737
|
+
prettyLabel: string;
|
|
738
|
+
repoName: string;
|
|
739
|
+
repoUrl: string;
|
|
740
|
+
docsUrl: string;
|
|
741
|
+
snippets: (model: ModelData) => string[];
|
|
742
|
+
filter: true;
|
|
743
|
+
};
|
|
744
|
+
fairseq: {
|
|
745
|
+
prettyLabel: string;
|
|
746
|
+
repoName: string;
|
|
747
|
+
repoUrl: string;
|
|
748
|
+
snippets: (model: ModelData) => string[];
|
|
749
|
+
filter: true;
|
|
750
|
+
};
|
|
751
|
+
fastai: {
|
|
752
|
+
prettyLabel: string;
|
|
753
|
+
repoName: string;
|
|
754
|
+
repoUrl: string;
|
|
755
|
+
docsUrl: string;
|
|
756
|
+
snippets: (model: ModelData) => string[];
|
|
757
|
+
filter: true;
|
|
758
|
+
};
|
|
759
|
+
fasttext: {
|
|
760
|
+
prettyLabel: string;
|
|
761
|
+
repoName: string;
|
|
762
|
+
repoUrl: string;
|
|
763
|
+
snippets: (model: ModelData) => string[];
|
|
764
|
+
filter: true;
|
|
765
|
+
};
|
|
766
|
+
flair: {
|
|
767
|
+
prettyLabel: string;
|
|
768
|
+
repoName: string;
|
|
769
|
+
repoUrl: string;
|
|
770
|
+
docsUrl: string;
|
|
771
|
+
snippets: (model: ModelData) => string[];
|
|
772
|
+
filter: true;
|
|
773
|
+
countDownloads: {
|
|
774
|
+
term: {
|
|
775
|
+
path: string;
|
|
776
|
+
};
|
|
777
|
+
};
|
|
778
|
+
};
|
|
779
|
+
keras: {
|
|
780
|
+
prettyLabel: string;
|
|
781
|
+
repoName: string;
|
|
782
|
+
repoUrl: string;
|
|
783
|
+
docsUrl: string;
|
|
784
|
+
snippets: (model: ModelData) => string[];
|
|
785
|
+
filter: true;
|
|
786
|
+
countDownloads: {
|
|
787
|
+
term: {
|
|
788
|
+
path: string;
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
};
|
|
792
|
+
k2: {
|
|
793
|
+
prettyLabel: string;
|
|
794
|
+
repoName: string;
|
|
795
|
+
repoUrl: string;
|
|
796
|
+
};
|
|
797
|
+
mindspore: {
|
|
798
|
+
prettyLabel: string;
|
|
799
|
+
repoName: string;
|
|
800
|
+
repoUrl: string;
|
|
801
|
+
};
|
|
802
|
+
"ml-agents": {
|
|
803
|
+
prettyLabel: string;
|
|
804
|
+
repoName: string;
|
|
805
|
+
repoUrl: string;
|
|
806
|
+
docsUrl: string;
|
|
807
|
+
snippets: (model: ModelData) => string[];
|
|
808
|
+
filter: true;
|
|
809
|
+
countDownloads: {
|
|
810
|
+
wildcard: {
|
|
811
|
+
path: string;
|
|
812
|
+
};
|
|
813
|
+
};
|
|
814
|
+
};
|
|
815
|
+
mlx: {
|
|
816
|
+
prettyLabel: string;
|
|
817
|
+
repoName: string;
|
|
818
|
+
repoUrl: string;
|
|
819
|
+
snippets: (model: ModelData) => string[];
|
|
820
|
+
filter: true;
|
|
821
|
+
};
|
|
822
|
+
nemo: {
|
|
823
|
+
prettyLabel: string;
|
|
824
|
+
repoName: string;
|
|
825
|
+
repoUrl: string;
|
|
826
|
+
snippets: (model: ModelData) => string[];
|
|
827
|
+
filter: true;
|
|
828
|
+
countDownloads: {
|
|
829
|
+
wildcard: {
|
|
830
|
+
path: string;
|
|
831
|
+
};
|
|
832
|
+
};
|
|
833
|
+
};
|
|
834
|
+
open_clip: {
|
|
835
|
+
prettyLabel: string;
|
|
836
|
+
repoName: string;
|
|
837
|
+
repoUrl: string;
|
|
838
|
+
snippets: (model: ModelData) => string[];
|
|
839
|
+
filter: true;
|
|
840
|
+
countDownloads: {
|
|
841
|
+
wildcard: {
|
|
842
|
+
path: string;
|
|
843
|
+
};
|
|
844
|
+
};
|
|
845
|
+
};
|
|
846
|
+
paddlenlp: {
|
|
847
|
+
prettyLabel: string;
|
|
848
|
+
repoName: string;
|
|
849
|
+
repoUrl: string;
|
|
850
|
+
docsUrl: string;
|
|
851
|
+
snippets: (model: ModelData) => string[];
|
|
852
|
+
filter: true;
|
|
853
|
+
countDownloads: {
|
|
854
|
+
term: {
|
|
855
|
+
path: string;
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
peft: {
|
|
860
|
+
prettyLabel: string;
|
|
861
|
+
repoName: string;
|
|
862
|
+
repoUrl: string;
|
|
863
|
+
snippets: (model: ModelData) => string[];
|
|
864
|
+
filter: true;
|
|
865
|
+
countDownloads: {
|
|
866
|
+
term: {
|
|
867
|
+
path: string;
|
|
868
|
+
};
|
|
869
|
+
};
|
|
870
|
+
};
|
|
871
|
+
"pyannote-audio": {
|
|
872
|
+
prettyLabel: string;
|
|
873
|
+
repoName: string;
|
|
874
|
+
repoUrl: string;
|
|
875
|
+
snippets: (model: ModelData) => string[];
|
|
876
|
+
filter: true;
|
|
877
|
+
};
|
|
878
|
+
pythae: {
|
|
879
|
+
prettyLabel: string;
|
|
880
|
+
repoName: string;
|
|
881
|
+
repoUrl: string;
|
|
882
|
+
snippets: (model: ModelData) => string[];
|
|
883
|
+
filter: true;
|
|
884
|
+
};
|
|
885
|
+
"sample-factory": {
|
|
886
|
+
prettyLabel: string;
|
|
887
|
+
repoName: string;
|
|
888
|
+
repoUrl: string;
|
|
889
|
+
docsUrl: string;
|
|
890
|
+
snippets: (model: ModelData) => string[];
|
|
891
|
+
filter: true;
|
|
892
|
+
countDownloads: {
|
|
893
|
+
term: {
|
|
894
|
+
path: string;
|
|
895
|
+
};
|
|
896
|
+
};
|
|
897
|
+
};
|
|
898
|
+
"sentence-transformers": {
|
|
899
|
+
prettyLabel: string;
|
|
900
|
+
repoName: string;
|
|
901
|
+
repoUrl: string;
|
|
902
|
+
docsUrl: string;
|
|
903
|
+
snippets: (model: ModelData) => string[];
|
|
904
|
+
filter: true;
|
|
905
|
+
};
|
|
906
|
+
setfit: {
|
|
907
|
+
prettyLabel: string;
|
|
908
|
+
repoName: string;
|
|
909
|
+
repoUrl: string;
|
|
910
|
+
docsUrl: string;
|
|
911
|
+
snippets: (model: ModelData) => string[];
|
|
912
|
+
filter: true;
|
|
913
|
+
};
|
|
914
|
+
sklearn: {
|
|
915
|
+
prettyLabel: string;
|
|
916
|
+
repoName: string;
|
|
917
|
+
repoUrl: string;
|
|
918
|
+
snippets: (model: ModelData) => string[];
|
|
919
|
+
filter: true;
|
|
920
|
+
countDownloads: {
|
|
921
|
+
term: {
|
|
922
|
+
path: string;
|
|
923
|
+
};
|
|
924
|
+
};
|
|
925
|
+
};
|
|
926
|
+
spacy: {
|
|
927
|
+
prettyLabel: string;
|
|
928
|
+
repoName: string;
|
|
929
|
+
repoUrl: string;
|
|
930
|
+
docsUrl: string;
|
|
931
|
+
snippets: (model: ModelData) => string[];
|
|
932
|
+
filter: true;
|
|
933
|
+
countDownloads: {
|
|
934
|
+
wildcard: {
|
|
935
|
+
path: string;
|
|
936
|
+
};
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
"span-marker": {
|
|
940
|
+
prettyLabel: string;
|
|
941
|
+
repoName: string;
|
|
942
|
+
repoUrl: string;
|
|
943
|
+
docsUrl: string;
|
|
944
|
+
snippets: (model: ModelData) => string[];
|
|
945
|
+
filter: true;
|
|
946
|
+
};
|
|
947
|
+
speechbrain: {
|
|
948
|
+
prettyLabel: string;
|
|
949
|
+
repoName: string;
|
|
950
|
+
repoUrl: string;
|
|
951
|
+
docsUrl: string;
|
|
952
|
+
snippets: (model: ModelData) => string[];
|
|
953
|
+
filter: true;
|
|
954
|
+
countDownloads: {
|
|
955
|
+
term: {
|
|
956
|
+
path: string;
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
};
|
|
960
|
+
"stable-baselines3": {
|
|
961
|
+
prettyLabel: string;
|
|
962
|
+
repoName: string;
|
|
963
|
+
repoUrl: string;
|
|
964
|
+
docsUrl: string;
|
|
965
|
+
snippets: (model: ModelData) => string[];
|
|
966
|
+
filter: true;
|
|
967
|
+
countDownloads: {
|
|
968
|
+
wildcard: {
|
|
969
|
+
path: string;
|
|
970
|
+
};
|
|
971
|
+
};
|
|
972
|
+
};
|
|
973
|
+
stanza: {
|
|
974
|
+
prettyLabel: string;
|
|
975
|
+
repoName: string;
|
|
976
|
+
repoUrl: string;
|
|
977
|
+
docsUrl: string;
|
|
978
|
+
snippets: (model: ModelData) => string[];
|
|
979
|
+
filter: true;
|
|
980
|
+
countDownloads: {
|
|
981
|
+
term: {
|
|
982
|
+
path: string;
|
|
983
|
+
};
|
|
984
|
+
};
|
|
985
|
+
};
|
|
986
|
+
tensorflowtts: {
|
|
987
|
+
prettyLabel: string;
|
|
988
|
+
repoName: string;
|
|
989
|
+
repoUrl: string;
|
|
990
|
+
snippets: (model: ModelData) => string[];
|
|
991
|
+
};
|
|
992
|
+
timm: {
|
|
993
|
+
prettyLabel: string;
|
|
994
|
+
repoName: string;
|
|
995
|
+
repoUrl: string;
|
|
996
|
+
docsUrl: string;
|
|
997
|
+
snippets: (model: ModelData) => string[];
|
|
998
|
+
filter: true;
|
|
999
|
+
countDownloads: {
|
|
1000
|
+
terms: {
|
|
1001
|
+
path: string[];
|
|
1002
|
+
};
|
|
1003
|
+
};
|
|
1004
|
+
};
|
|
1005
|
+
transformers: {
|
|
1006
|
+
prettyLabel: string;
|
|
1007
|
+
repoName: string;
|
|
1008
|
+
repoUrl: string;
|
|
1009
|
+
docsUrl: string;
|
|
1010
|
+
snippets: (model: ModelData) => string[];
|
|
1011
|
+
filter: true;
|
|
1012
|
+
};
|
|
1013
|
+
"transformers.js": {
|
|
1014
|
+
prettyLabel: string;
|
|
1015
|
+
repoName: string;
|
|
1016
|
+
repoUrl: string;
|
|
1017
|
+
docsUrl: string;
|
|
1018
|
+
snippets: (model: ModelData) => string[];
|
|
1019
|
+
filter: true;
|
|
1020
|
+
};
|
|
1021
|
+
"unity-sentis": {
|
|
1022
|
+
prettyLabel: string;
|
|
1023
|
+
repoName: string;
|
|
1024
|
+
repoUrl: string;
|
|
1025
|
+
snippets: () => string[];
|
|
1026
|
+
filter: true;
|
|
1027
|
+
countDownloads: {
|
|
1028
|
+
wildcard: {
|
|
1029
|
+
path: string;
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
};
|
|
1034
|
+
type ModelLibraryKey = keyof typeof MODEL_LIBRARIES_UI_ELEMENTS;
|
|
1035
|
+
declare const ALL_MODEL_LIBRARY_KEYS: ("sklearn" | "adapter-transformers" | "allennlp" | "asteroid" | "bertopic" | "diffusers" | "doctr" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "keras" | "k2" | "mindspore" | "ml-agents" | "mlx" | "nemo" | "open_clip" | "paddlenlp" | "peft" | "pyannote-audio" | "pythae" | "sample-factory" | "sentence-transformers" | "setfit" | "spacy" | "span-marker" | "speechbrain" | "stable-baselines3" | "stanza" | "tensorflowtts" | "timm" | "transformers" | "transformers.js" | "unity-sentis")[];
|
|
1036
|
+
declare const ALL_DISPLAY_MODEL_LIBRARY_KEYS: ("sklearn" | "adapter-transformers" | "allennlp" | "asteroid" | "bertopic" | "diffusers" | "doctr" | "espnet" | "fairseq" | "fastai" | "fasttext" | "flair" | "keras" | "k2" | "mindspore" | "ml-agents" | "mlx" | "nemo" | "open_clip" | "paddlenlp" | "peft" | "pyannote-audio" | "pythae" | "sample-factory" | "sentence-transformers" | "setfit" | "spacy" | "span-marker" | "speechbrain" | "stable-baselines3" | "stanza" | "tensorflowtts" | "timm" | "transformers" | "transformers.js" | "unity-sentis")[];
|
|
1037
|
+
|
|
1038
|
+
/**
|
|
1039
|
+
* Mapping from library name (excluding Transformers) to its supported tasks.
|
|
1040
|
+
* Inference API (serverless) should be disabled for all other (library, task) pairs beyond this mapping.
|
|
1041
|
+
* As an exception, we assume Transformers supports all inference tasks.
|
|
1042
|
+
* This mapping is generated automatically by "python-api-export-tasks" action in huggingface/api-inference-community repo upon merge.
|
|
1043
|
+
* Ref: https://github.com/huggingface/api-inference-community/pull/158
|
|
1044
|
+
*/
|
|
1045
|
+
declare const LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS: Partial<Record<ModelLibraryKey, PipelineType[]>>;
|
|
685
1046
|
|
|
686
1047
|
type PerLanguageMapping = Map<PipelineType, string[] | WidgetExample[]>;
|
|
687
1048
|
declare const MAPPING_DEFAULT_WIDGET: Map<string, PerLanguageMapping>;
|
|
@@ -731,6 +1092,7 @@ interface TaskData {
|
|
|
731
1092
|
datasets: ExampleRepo[];
|
|
732
1093
|
demo: TaskDemo;
|
|
733
1094
|
id: PipelineType;
|
|
1095
|
+
canonicalId?: PipelineType;
|
|
734
1096
|
isPlaceholder?: boolean;
|
|
735
1097
|
label: string;
|
|
736
1098
|
libraries: ModelLibraryKey[];
|
|
@@ -850,4 +1212,4 @@ declare namespace index {
|
|
|
850
1212
|
};
|
|
851
1213
|
}
|
|
852
1214
|
|
|
853
|
-
export { ALL_DISPLAY_MODEL_LIBRARY_KEYS, ExampleRepo, InferenceDisplayability, LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS, LibraryUiElement, MAPPING_DEFAULT_WIDGET, MODALITIES, MODALITY_LABELS, MODEL_LIBRARIES_UI_ELEMENTS, Modality, ModelData,
|
|
1215
|
+
export { ALL_DISPLAY_MODEL_LIBRARY_KEYS, ALL_MODEL_LIBRARY_KEYS, ExampleRepo, InferenceDisplayability, LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS, LibraryUiElement, MAPPING_DEFAULT_WIDGET, MODALITIES, MODALITY_LABELS, MODEL_LIBRARIES_UI_ELEMENTS, Modality, ModelData, ModelLibraryKey, PIPELINE_DATA, PIPELINE_TYPES, PIPELINE_TYPES_SET, PipelineData, PipelineType, SUBTASK_TYPES, TASKS_DATA, TASKS_MODEL_LIBRARIES, TaskData, TaskDataCustom, TaskDemo, TaskDemoEntry, TransformersInfo, WidgetExample, WidgetExampleAssetAndPromptInput, WidgetExampleAssetAndTextInput, WidgetExampleAssetAndZeroShotInput, WidgetExampleAssetInput, WidgetExampleAttribute, WidgetExampleOutput, WidgetExampleOutputAnswerScore, WidgetExampleOutputLabels, WidgetExampleOutputText, WidgetExampleOutputUrl, WidgetExampleSentenceSimilarityInput, WidgetExampleStructuredDataInput, WidgetExampleTableDataInput, WidgetExampleTextAndContextInput, WidgetExampleTextAndTableInput, WidgetExampleTextInput, WidgetExampleZeroShotTextInput, index as snippets };
|