@huggingface/tasks 0.2.2 → 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.
Files changed (77) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs +3136 -3085
  3. package/dist/index.d.ts +425 -64
  4. package/dist/index.js +3135 -3084
  5. package/package.json +1 -1
  6. package/src/index.ts +2 -5
  7. package/src/library-to-tasks.ts +1 -1
  8. package/src/model-libraries-downloads.ts +20 -0
  9. package/src/{library-ui-elements.ts → model-libraries-snippets.ts} +46 -292
  10. package/src/model-libraries.ts +375 -44
  11. package/src/tasks/audio-classification/inference.ts +4 -4
  12. package/src/tasks/audio-classification/spec/input.json +4 -4
  13. package/src/tasks/audio-classification/spec/output.json +1 -12
  14. package/src/tasks/automatic-speech-recognition/inference.ts +35 -30
  15. package/src/tasks/automatic-speech-recognition/spec/input.json +3 -3
  16. package/src/tasks/automatic-speech-recognition/spec/output.json +30 -28
  17. package/src/tasks/common-definitions.json +25 -17
  18. package/src/tasks/depth-estimation/inference.ts +10 -10
  19. package/src/tasks/depth-estimation/spec/input.json +3 -8
  20. package/src/tasks/depth-estimation/spec/output.json +9 -3
  21. package/src/tasks/document-question-answering/inference.ts +16 -8
  22. package/src/tasks/document-question-answering/spec/input.json +9 -9
  23. package/src/tasks/document-question-answering/spec/output.json +2 -2
  24. package/src/tasks/feature-extraction/inference.ts +1 -1
  25. package/src/tasks/feature-extraction/spec/input.json +2 -2
  26. package/src/tasks/fill-mask/inference.ts +4 -3
  27. package/src/tasks/fill-mask/spec/input.json +3 -3
  28. package/src/tasks/fill-mask/spec/output.json +1 -1
  29. package/src/tasks/image-classification/inference.ts +3 -3
  30. package/src/tasks/image-classification/spec/input.json +4 -4
  31. package/src/tasks/image-segmentation/inference.ts +3 -3
  32. package/src/tasks/image-segmentation/spec/input.json +4 -4
  33. package/src/tasks/image-to-image/inference.ts +5 -5
  34. package/src/tasks/image-to-image/spec/input.json +9 -7
  35. package/src/tasks/image-to-text/inference.ts +25 -20
  36. package/src/tasks/image-to-text/spec/input.json +3 -3
  37. package/src/tasks/image-to-text/spec/output.json +8 -11
  38. package/src/tasks/object-detection/inference.ts +1 -1
  39. package/src/tasks/object-detection/spec/input.json +2 -2
  40. package/src/tasks/placeholder/spec/input.json +4 -4
  41. package/src/tasks/placeholder/spec/output.json +1 -1
  42. package/src/tasks/question-answering/inference.ts +8 -8
  43. package/src/tasks/question-answering/spec/input.json +9 -9
  44. package/src/tasks/sentence-similarity/inference.ts +1 -1
  45. package/src/tasks/sentence-similarity/spec/input.json +2 -2
  46. package/src/tasks/summarization/inference.ts +5 -4
  47. package/src/tasks/table-question-answering/inference.ts +1 -1
  48. package/src/tasks/table-question-answering/spec/input.json +8 -3
  49. package/src/tasks/text-classification/inference.ts +3 -3
  50. package/src/tasks/text-classification/spec/input.json +4 -4
  51. package/src/tasks/text-generation/inference.ts +123 -14
  52. package/src/tasks/text-generation/spec/input.json +28 -12
  53. package/src/tasks/text-generation/spec/output.json +112 -9
  54. package/src/tasks/text-to-audio/inference.ts +24 -19
  55. package/src/tasks/text-to-audio/spec/input.json +2 -2
  56. package/src/tasks/text-to-audio/spec/output.json +10 -13
  57. package/src/tasks/text-to-image/inference.ts +6 -8
  58. package/src/tasks/text-to-image/spec/input.json +9 -7
  59. package/src/tasks/text-to-image/spec/output.json +7 -9
  60. package/src/tasks/text-to-speech/inference.ts +18 -17
  61. package/src/tasks/text2text-generation/inference.ts +10 -8
  62. package/src/tasks/text2text-generation/spec/input.json +4 -4
  63. package/src/tasks/text2text-generation/spec/output.json +8 -11
  64. package/src/tasks/token-classification/inference.ts +4 -4
  65. package/src/tasks/token-classification/spec/input.json +4 -4
  66. package/src/tasks/token-classification/spec/output.json +1 -1
  67. package/src/tasks/translation/inference.ts +5 -4
  68. package/src/tasks/video-classification/inference.ts +5 -5
  69. package/src/tasks/video-classification/spec/input.json +6 -6
  70. package/src/tasks/visual-question-answering/inference.ts +2 -2
  71. package/src/tasks/visual-question-answering/spec/input.json +3 -3
  72. package/src/tasks/zero-shot-classification/inference.ts +3 -3
  73. package/src/tasks/zero-shot-classification/spec/input.json +4 -4
  74. package/src/tasks/zero-shot-image-classification/inference.ts +2 -2
  75. package/src/tasks/zero-shot-image-classification/spec/input.json +3 -3
  76. package/src/tasks/zero-shot-object-detection/inference.ts +1 -1
  77. package/src/tasks/zero-shot-object-detection/spec/input.json +2 -2
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" = "Adapters",
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 Endpoints (serverless) 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
  */
@@ -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
- * Name displayed on the main
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
- btnLabel: string;
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
- snippets: (model: ModelData) => string[];
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
- declare const MODEL_LIBRARIES_UI_ELEMENTS: Partial<Record<ModelLibraryKey, LibraryUiElement>>;
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>;
@@ -851,4 +1212,4 @@ declare namespace index {
851
1212
  };
852
1213
  }
853
1214
 
854
- 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, ModelLibrary, 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 };
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 };