@huggingface/tasks 0.9.0 → 0.10.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 +12 -14
- package/dist/index.cjs +91 -18
- package/dist/index.js +90 -18
- package/dist/scripts/inference-codegen.d.ts +2 -0
- package/dist/scripts/inference-codegen.d.ts.map +1 -0
- package/dist/scripts/inference-tgi-import.d.ts +2 -0
- package/dist/scripts/inference-tgi-import.d.ts.map +1 -0
- package/dist/src/default-widget-inputs.d.ts +6 -0
- package/dist/src/default-widget-inputs.d.ts.map +1 -0
- package/dist/src/index.d.ts +17 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/library-to-tasks.d.ts +11 -0
- package/dist/src/library-to-tasks.d.ts.map +1 -0
- package/dist/src/local-apps.d.ts +104 -0
- package/dist/src/local-apps.d.ts.map +1 -0
- package/dist/src/model-data.d.ts +144 -0
- package/dist/src/model-data.d.ts.map +1 -0
- package/dist/src/model-libraries-downloads.d.ts +26 -0
- package/dist/src/model-libraries-downloads.d.ts.map +1 -0
- package/dist/src/model-libraries-snippets.d.ts +43 -0
- package/dist/src/model-libraries-snippets.d.ts.map +1 -0
- package/dist/src/model-libraries.d.ts +490 -0
- package/dist/src/model-libraries.d.ts.map +1 -0
- package/dist/src/pipelines.d.ts +404 -0
- package/dist/src/pipelines.d.ts.map +1 -0
- package/dist/src/snippets/curl.d.ts +9 -0
- package/dist/src/snippets/curl.d.ts.map +1 -0
- package/dist/src/snippets/index.d.ts +6 -0
- package/dist/src/snippets/index.d.ts.map +1 -0
- package/dist/src/snippets/inputs.d.ts +3 -0
- package/dist/src/snippets/inputs.d.ts.map +1 -0
- package/dist/src/snippets/js.d.ts +11 -0
- package/dist/src/snippets/js.d.ts.map +1 -0
- package/dist/src/snippets/python.d.ts +14 -0
- package/dist/src/snippets/python.d.ts.map +1 -0
- package/dist/src/snippets/types.d.ts +8 -0
- package/dist/src/snippets/types.d.ts.map +1 -0
- package/dist/src/tasks/audio-classification/data.d.ts +4 -0
- package/dist/src/tasks/audio-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/audio-classification/inference.d.ts +52 -0
- package/dist/src/tasks/audio-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/audio-to-audio/data.d.ts +4 -0
- package/dist/src/tasks/audio-to-audio/data.d.ts.map +1 -0
- package/dist/src/tasks/automatic-speech-recognition/data.d.ts +4 -0
- package/dist/src/tasks/automatic-speech-recognition/data.d.ts.map +1 -0
- package/dist/src/tasks/automatic-speech-recognition/inference.d.ts +154 -0
- package/dist/src/tasks/automatic-speech-recognition/inference.d.ts.map +1 -0
- package/dist/src/tasks/chat-completion/inference.d.ts +254 -0
- package/dist/src/tasks/chat-completion/inference.d.ts.map +1 -0
- package/dist/src/tasks/depth-estimation/data.d.ts +4 -0
- package/dist/src/tasks/depth-estimation/data.d.ts.map +1 -0
- package/dist/src/tasks/depth-estimation/inference.d.ts +36 -0
- package/dist/src/tasks/depth-estimation/inference.d.ts.map +1 -0
- package/dist/src/tasks/document-question-answering/data.d.ts +4 -0
- package/dist/src/tasks/document-question-answering/data.d.ts.map +1 -0
- package/dist/src/tasks/document-question-answering/inference.d.ts +111 -0
- package/dist/src/tasks/document-question-answering/inference.d.ts.map +1 -0
- package/dist/src/tasks/feature-extraction/data.d.ts +4 -0
- package/dist/src/tasks/feature-extraction/data.d.ts.map +1 -0
- package/dist/src/tasks/feature-extraction/inference.d.ts +23 -0
- package/dist/src/tasks/feature-extraction/inference.d.ts.map +1 -0
- package/dist/src/tasks/fill-mask/data.d.ts +4 -0
- package/dist/src/tasks/fill-mask/data.d.ts.map +1 -0
- package/dist/src/tasks/fill-mask/inference.d.ts +63 -0
- package/dist/src/tasks/fill-mask/inference.d.ts.map +1 -0
- package/dist/src/tasks/image-classification/data.d.ts +4 -0
- package/dist/src/tasks/image-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/image-classification/inference.d.ts +52 -0
- package/dist/src/tasks/image-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/image-feature-extraction/data.d.ts +4 -0
- package/dist/src/tasks/image-feature-extraction/data.d.ts.map +1 -0
- package/dist/src/tasks/image-segmentation/data.d.ts +4 -0
- package/dist/src/tasks/image-segmentation/data.d.ts.map +1 -0
- package/dist/src/tasks/image-segmentation/inference.d.ts +66 -0
- package/dist/src/tasks/image-segmentation/inference.d.ts.map +1 -0
- package/dist/src/tasks/image-to-image/data.d.ts +4 -0
- package/dist/src/tasks/image-to-image/data.d.ts.map +1 -0
- package/dist/src/tasks/image-to-image/inference.d.ts +64 -0
- package/dist/src/tasks/image-to-image/inference.d.ts.map +1 -0
- package/dist/src/tasks/image-to-text/data.d.ts +4 -0
- package/dist/src/tasks/image-to-text/data.d.ts.map +1 -0
- package/dist/src/tasks/image-to-text/inference.d.ts +139 -0
- package/dist/src/tasks/image-to-text/inference.d.ts.map +1 -0
- package/dist/src/tasks/index.d.ts +87 -0
- package/dist/src/tasks/index.d.ts.map +1 -0
- package/dist/src/tasks/mask-generation/data.d.ts +4 -0
- package/dist/src/tasks/mask-generation/data.d.ts.map +1 -0
- package/dist/src/tasks/object-detection/data.d.ts +4 -0
- package/dist/src/tasks/object-detection/data.d.ts.map +1 -0
- package/dist/src/tasks/object-detection/inference.d.ts +63 -0
- package/dist/src/tasks/object-detection/inference.d.ts.map +1 -0
- package/dist/src/tasks/placeholder/data.d.ts +4 -0
- package/dist/src/tasks/placeholder/data.d.ts.map +1 -0
- package/dist/src/tasks/question-answering/data.d.ts +4 -0
- package/dist/src/tasks/question-answering/data.d.ts.map +1 -0
- package/dist/src/tasks/question-answering/inference.d.ts +100 -0
- package/dist/src/tasks/question-answering/inference.d.ts.map +1 -0
- package/dist/src/tasks/reinforcement-learning/data.d.ts +4 -0
- package/dist/src/tasks/reinforcement-learning/data.d.ts.map +1 -0
- package/dist/src/tasks/sentence-similarity/data.d.ts +4 -0
- package/dist/src/tasks/sentence-similarity/data.d.ts.map +1 -0
- package/dist/src/tasks/sentence-similarity/inference.d.ts +32 -0
- package/dist/src/tasks/sentence-similarity/inference.d.ts.map +1 -0
- package/dist/src/tasks/summarization/data.d.ts +4 -0
- package/dist/src/tasks/summarization/data.d.ts.map +1 -0
- package/dist/src/tasks/summarization/inference.d.ts +55 -0
- package/dist/src/tasks/summarization/inference.d.ts.map +1 -0
- package/dist/src/tasks/table-question-answering/data.d.ts +4 -0
- package/dist/src/tasks/table-question-answering/data.d.ts.map +1 -0
- package/dist/src/tasks/table-question-answering/inference.d.ts +62 -0
- package/dist/src/tasks/table-question-answering/inference.d.ts.map +1 -0
- package/dist/src/tasks/tabular-classification/data.d.ts +4 -0
- package/dist/src/tasks/tabular-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/tabular-regression/data.d.ts +4 -0
- package/dist/src/tasks/tabular-regression/data.d.ts.map +1 -0
- package/dist/src/tasks/text-classification/data.d.ts +4 -0
- package/dist/src/tasks/text-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/text-classification/inference.d.ts +52 -0
- package/dist/src/tasks/text-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/text-generation/data.d.ts +4 -0
- package/dist/src/tasks/text-generation/data.d.ts.map +1 -0
- package/dist/src/tasks/text-generation/inference.d.ts +126 -0
- package/dist/src/tasks/text-generation/inference.d.ts.map +1 -0
- package/dist/src/tasks/text-to-audio/inference.d.ts +139 -0
- package/dist/src/tasks/text-to-audio/inference.d.ts.map +1 -0
- package/dist/src/tasks/text-to-image/data.d.ts +4 -0
- package/dist/src/tasks/text-to-image/data.d.ts.map +1 -0
- package/dist/src/tasks/text-to-image/inference.d.ts +68 -0
- package/dist/src/tasks/text-to-image/inference.d.ts.map +1 -0
- package/dist/src/tasks/text-to-speech/data.d.ts +4 -0
- package/dist/src/tasks/text-to-speech/data.d.ts.map +1 -0
- package/dist/src/tasks/text-to-speech/inference.d.ts +143 -0
- package/dist/src/tasks/text-to-speech/inference.d.ts.map +1 -0
- package/dist/src/tasks/text-to-video/data.d.ts +4 -0
- package/dist/src/tasks/text-to-video/data.d.ts.map +1 -0
- package/dist/src/tasks/text2text-generation/inference.d.ts +54 -0
- package/dist/src/tasks/text2text-generation/inference.d.ts.map +1 -0
- package/dist/src/tasks/token-classification/data.d.ts +4 -0
- package/dist/src/tasks/token-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/token-classification/inference.d.ts +83 -0
- package/dist/src/tasks/token-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/translation/data.d.ts +4 -0
- package/dist/src/tasks/translation/data.d.ts.map +1 -0
- package/dist/src/tasks/translation/inference.d.ts +55 -0
- package/dist/src/tasks/translation/inference.d.ts.map +1 -0
- package/dist/src/tasks/unconditional-image-generation/data.d.ts +4 -0
- package/dist/src/tasks/unconditional-image-generation/data.d.ts.map +1 -0
- package/dist/src/tasks/video-classification/data.d.ts +4 -0
- package/dist/src/tasks/video-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/video-classification/inference.d.ts +60 -0
- package/dist/src/tasks/video-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/visual-question-answering/data.d.ts +4 -0
- package/dist/src/tasks/visual-question-answering/data.d.ts.map +1 -0
- package/dist/src/tasks/visual-question-answering/inference.d.ts +64 -0
- package/dist/src/tasks/visual-question-answering/inference.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-classification/data.d.ts +4 -0
- package/dist/src/tasks/zero-shot-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-classification/inference.d.ts +68 -0
- package/dist/src/tasks/zero-shot-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-image-classification/data.d.ts +4 -0
- package/dist/src/tasks/zero-shot-image-classification/data.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-image-classification/inference.d.ts +62 -0
- package/dist/src/tasks/zero-shot-image-classification/inference.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-object-detection/data.d.ts +4 -0
- package/dist/src/tasks/zero-shot-object-detection/data.d.ts.map +1 -0
- package/dist/src/tasks/zero-shot-object-detection/inference.d.ts +67 -0
- package/dist/src/tasks/zero-shot-object-detection/inference.d.ts.map +1 -0
- package/dist/src/tokenizer-data.d.ts +26 -0
- package/dist/src/tokenizer-data.d.ts.map +1 -0
- package/dist/src/widget-example.d.ts +86 -0
- package/dist/src/widget-example.d.ts.map +1 -0
- package/package.json +11 -6
- package/src/index.ts +3 -0
- package/src/local-apps.ts +119 -0
- package/src/model-data.ts +1 -5
- package/src/model-libraries-snippets.ts +21 -18
- package/src/model-libraries.ts +9 -0
- package/src/tasks/chat-completion/inference.ts +204 -85
- package/src/tasks/chat-completion/spec/input.json +198 -34
- package/src/tasks/chat-completion/spec/output.json +178 -40
- package/src/tasks/chat-completion/spec/stream_output.json +170 -0
- package/src/tasks/index.ts +7 -8
- package/src/tasks/text-generation/inference.ts +58 -170
- package/src/tasks/text-generation/spec/input.json +130 -29
- package/src/tasks/text-generation/spec/output.json +104 -90
- package/src/tasks/text-generation/spec/stream_output.json +97 -0
- package/tsconfig.json +3 -1
- package/dist/index.d.ts +0 -3531
- package/src/tasks/chat-completion/spec/output_stream.json +0 -48
- package/src/tasks/text-generation/spec/output_stream.json +0 -47
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Text To Audio inference
|
|
8
|
+
*/
|
|
9
|
+
export interface TextToAudioInput {
|
|
10
|
+
/**
|
|
11
|
+
* The input text data
|
|
12
|
+
*/
|
|
13
|
+
inputs: string;
|
|
14
|
+
/**
|
|
15
|
+
* Additional inference parameters
|
|
16
|
+
*/
|
|
17
|
+
parameters?: TextToAudioParameters;
|
|
18
|
+
[property: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Text To Audio
|
|
24
|
+
*/
|
|
25
|
+
export interface TextToAudioParameters {
|
|
26
|
+
/**
|
|
27
|
+
* Parametrization of the text generation process
|
|
28
|
+
*/
|
|
29
|
+
generate?: GenerationParameters;
|
|
30
|
+
[property: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Parametrization of the text generation process
|
|
34
|
+
*
|
|
35
|
+
* Ad-hoc parametrization of the text generation process
|
|
36
|
+
*/
|
|
37
|
+
export interface GenerationParameters {
|
|
38
|
+
/**
|
|
39
|
+
* Whether to use sampling instead of greedy decoding when generating new tokens.
|
|
40
|
+
*/
|
|
41
|
+
do_sample?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Controls the stopping condition for beam-based methods.
|
|
44
|
+
*/
|
|
45
|
+
early_stopping?: EarlyStoppingUnion;
|
|
46
|
+
/**
|
|
47
|
+
* If set to float strictly between 0 and 1, only tokens with a conditional probability
|
|
48
|
+
* greater than epsilon_cutoff will be sampled. In the paper, suggested values range from
|
|
49
|
+
* 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language
|
|
50
|
+
* Model Desmoothing](https://hf.co/papers/2210.15191) for more details.
|
|
51
|
+
*/
|
|
52
|
+
epsilon_cutoff?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to
|
|
55
|
+
* float strictly between 0 and 1, a token is only considered if it is greater than either
|
|
56
|
+
* eta_cutoff or sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits))). The latter
|
|
57
|
+
* term is intuitively the expected next token probability, scaled by sqrt(eta_cutoff). In
|
|
58
|
+
* the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model.
|
|
59
|
+
* See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191)
|
|
60
|
+
* for more details.
|
|
61
|
+
*/
|
|
62
|
+
eta_cutoff?: number;
|
|
63
|
+
/**
|
|
64
|
+
* The maximum length (in tokens) of the generated text, including the input.
|
|
65
|
+
*/
|
|
66
|
+
max_length?: number;
|
|
67
|
+
/**
|
|
68
|
+
* The maximum number of tokens to generate. Takes precedence over maxLength.
|
|
69
|
+
*/
|
|
70
|
+
max_new_tokens?: number;
|
|
71
|
+
/**
|
|
72
|
+
* The minimum length (in tokens) of the generated text, including the input.
|
|
73
|
+
*/
|
|
74
|
+
min_length?: number;
|
|
75
|
+
/**
|
|
76
|
+
* The minimum number of tokens to generate. Takes precedence over maxLength.
|
|
77
|
+
*/
|
|
78
|
+
min_new_tokens?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Number of groups to divide num_beams into in order to ensure diversity among different
|
|
81
|
+
* groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details.
|
|
82
|
+
*/
|
|
83
|
+
num_beam_groups?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Number of beams to use for beam search.
|
|
86
|
+
*/
|
|
87
|
+
num_beams?: number;
|
|
88
|
+
/**
|
|
89
|
+
* The value balances the model confidence and the degeneration penalty in contrastive
|
|
90
|
+
* search decoding.
|
|
91
|
+
*/
|
|
92
|
+
penalty_alpha?: number;
|
|
93
|
+
/**
|
|
94
|
+
* The value used to modulate the next token probabilities.
|
|
95
|
+
*/
|
|
96
|
+
temperature?: number;
|
|
97
|
+
/**
|
|
98
|
+
* The number of highest probability vocabulary tokens to keep for top-k-filtering.
|
|
99
|
+
*/
|
|
100
|
+
top_k?: number;
|
|
101
|
+
/**
|
|
102
|
+
* If set to float < 1, only the smallest set of most probable tokens with probabilities
|
|
103
|
+
* that add up to top_p or higher are kept for generation.
|
|
104
|
+
*/
|
|
105
|
+
top_p?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Local typicality measures how similar the conditional probability of predicting a target
|
|
108
|
+
* token next is to the expected conditional probability of predicting a random token next,
|
|
109
|
+
* given the partial text already generated. If set to float < 1, the smallest set of the
|
|
110
|
+
* most locally typical tokens with probabilities that add up to typical_p or higher are
|
|
111
|
+
* kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details.
|
|
112
|
+
*/
|
|
113
|
+
typical_p?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Whether the model should use the past last key/values attentions to speed up decoding
|
|
116
|
+
*/
|
|
117
|
+
use_cache?: boolean;
|
|
118
|
+
[property: string]: unknown;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Controls the stopping condition for beam-based methods.
|
|
122
|
+
*/
|
|
123
|
+
export type EarlyStoppingUnion = boolean | "never";
|
|
124
|
+
/**
|
|
125
|
+
* Outputs of inference for the Text To Audio task
|
|
126
|
+
*/
|
|
127
|
+
export interface TextToAudioOutput {
|
|
128
|
+
/**
|
|
129
|
+
* The generated audio waveform.
|
|
130
|
+
*/
|
|
131
|
+
audio: unknown;
|
|
132
|
+
samplingRate: unknown;
|
|
133
|
+
/**
|
|
134
|
+
* The sampling rate of the generated audio waveform.
|
|
135
|
+
*/
|
|
136
|
+
sampling_rate?: number;
|
|
137
|
+
[property: string]: unknown;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-audio/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-image/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cA+Ff,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Text To Image inference
|
|
8
|
+
*/
|
|
9
|
+
export interface TextToImageInput {
|
|
10
|
+
/**
|
|
11
|
+
* The input text data (sometimes called "prompt"
|
|
12
|
+
*/
|
|
13
|
+
inputs: string;
|
|
14
|
+
/**
|
|
15
|
+
* Additional inference parameters
|
|
16
|
+
*/
|
|
17
|
+
parameters?: TextToImageParameters;
|
|
18
|
+
[property: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Text To Image
|
|
24
|
+
*/
|
|
25
|
+
export interface TextToImageParameters {
|
|
26
|
+
/**
|
|
27
|
+
* For diffusion models. A higher guidance scale value encourages the model to generate
|
|
28
|
+
* images closely linked to the text prompt at the expense of lower image quality.
|
|
29
|
+
*/
|
|
30
|
+
guidance_scale?: number;
|
|
31
|
+
/**
|
|
32
|
+
* One or several prompt to guide what NOT to include in image generation.
|
|
33
|
+
*/
|
|
34
|
+
negative_prompt?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* For diffusion models. The number of denoising steps. More denoising steps usually lead to
|
|
37
|
+
* a higher quality image at the expense of slower inference.
|
|
38
|
+
*/
|
|
39
|
+
num_inference_steps?: number;
|
|
40
|
+
/**
|
|
41
|
+
* For diffusion models. Override the scheduler with a compatible one
|
|
42
|
+
*/
|
|
43
|
+
scheduler?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The size in pixel of the output image
|
|
46
|
+
*/
|
|
47
|
+
target_size?: TargetSize;
|
|
48
|
+
[property: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The size in pixel of the output image
|
|
52
|
+
*/
|
|
53
|
+
export interface TargetSize {
|
|
54
|
+
height: number;
|
|
55
|
+
width: number;
|
|
56
|
+
[property: string]: unknown;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Outputs of inference for the Text To Image task
|
|
60
|
+
*/
|
|
61
|
+
export interface TextToImageOutput {
|
|
62
|
+
/**
|
|
63
|
+
* The generated image
|
|
64
|
+
*/
|
|
65
|
+
image: unknown;
|
|
66
|
+
[property: string]: unknown;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-image/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-speech/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAiEf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Text to Speech inference
|
|
8
|
+
*
|
|
9
|
+
* Inputs for Text To Audio inference
|
|
10
|
+
*/
|
|
11
|
+
export interface TextToSpeechInput {
|
|
12
|
+
/**
|
|
13
|
+
* The input text data
|
|
14
|
+
*/
|
|
15
|
+
inputs: string;
|
|
16
|
+
/**
|
|
17
|
+
* Additional inference parameters
|
|
18
|
+
*/
|
|
19
|
+
parameters?: TextToAudioParameters;
|
|
20
|
+
[property: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Additional inference parameters
|
|
24
|
+
*
|
|
25
|
+
* Additional inference parameters for Text To Audio
|
|
26
|
+
*/
|
|
27
|
+
export interface TextToAudioParameters {
|
|
28
|
+
/**
|
|
29
|
+
* Parametrization of the text generation process
|
|
30
|
+
*/
|
|
31
|
+
generate?: GenerationParameters;
|
|
32
|
+
[property: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parametrization of the text generation process
|
|
36
|
+
*
|
|
37
|
+
* Ad-hoc parametrization of the text generation process
|
|
38
|
+
*/
|
|
39
|
+
export interface GenerationParameters {
|
|
40
|
+
/**
|
|
41
|
+
* Whether to use sampling instead of greedy decoding when generating new tokens.
|
|
42
|
+
*/
|
|
43
|
+
do_sample?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Controls the stopping condition for beam-based methods.
|
|
46
|
+
*/
|
|
47
|
+
early_stopping?: EarlyStoppingUnion;
|
|
48
|
+
/**
|
|
49
|
+
* If set to float strictly between 0 and 1, only tokens with a conditional probability
|
|
50
|
+
* greater than epsilon_cutoff will be sampled. In the paper, suggested values range from
|
|
51
|
+
* 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language
|
|
52
|
+
* Model Desmoothing](https://hf.co/papers/2210.15191) for more details.
|
|
53
|
+
*/
|
|
54
|
+
epsilon_cutoff?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to
|
|
57
|
+
* float strictly between 0 and 1, a token is only considered if it is greater than either
|
|
58
|
+
* eta_cutoff or sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits))). The latter
|
|
59
|
+
* term is intuitively the expected next token probability, scaled by sqrt(eta_cutoff). In
|
|
60
|
+
* the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model.
|
|
61
|
+
* See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191)
|
|
62
|
+
* for more details.
|
|
63
|
+
*/
|
|
64
|
+
eta_cutoff?: number;
|
|
65
|
+
/**
|
|
66
|
+
* The maximum length (in tokens) of the generated text, including the input.
|
|
67
|
+
*/
|
|
68
|
+
max_length?: number;
|
|
69
|
+
/**
|
|
70
|
+
* The maximum number of tokens to generate. Takes precedence over maxLength.
|
|
71
|
+
*/
|
|
72
|
+
max_new_tokens?: number;
|
|
73
|
+
/**
|
|
74
|
+
* The minimum length (in tokens) of the generated text, including the input.
|
|
75
|
+
*/
|
|
76
|
+
min_length?: number;
|
|
77
|
+
/**
|
|
78
|
+
* The minimum number of tokens to generate. Takes precedence over maxLength.
|
|
79
|
+
*/
|
|
80
|
+
min_new_tokens?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Number of groups to divide num_beams into in order to ensure diversity among different
|
|
83
|
+
* groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details.
|
|
84
|
+
*/
|
|
85
|
+
num_beam_groups?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Number of beams to use for beam search.
|
|
88
|
+
*/
|
|
89
|
+
num_beams?: number;
|
|
90
|
+
/**
|
|
91
|
+
* The value balances the model confidence and the degeneration penalty in contrastive
|
|
92
|
+
* search decoding.
|
|
93
|
+
*/
|
|
94
|
+
penalty_alpha?: number;
|
|
95
|
+
/**
|
|
96
|
+
* The value used to modulate the next token probabilities.
|
|
97
|
+
*/
|
|
98
|
+
temperature?: number;
|
|
99
|
+
/**
|
|
100
|
+
* The number of highest probability vocabulary tokens to keep for top-k-filtering.
|
|
101
|
+
*/
|
|
102
|
+
top_k?: number;
|
|
103
|
+
/**
|
|
104
|
+
* If set to float < 1, only the smallest set of most probable tokens with probabilities
|
|
105
|
+
* that add up to top_p or higher are kept for generation.
|
|
106
|
+
*/
|
|
107
|
+
top_p?: number;
|
|
108
|
+
/**
|
|
109
|
+
* Local typicality measures how similar the conditional probability of predicting a target
|
|
110
|
+
* token next is to the expected conditional probability of predicting a random token next,
|
|
111
|
+
* given the partial text already generated. If set to float < 1, the smallest set of the
|
|
112
|
+
* most locally typical tokens with probabilities that add up to typical_p or higher are
|
|
113
|
+
* kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details.
|
|
114
|
+
*/
|
|
115
|
+
typical_p?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Whether the model should use the past last key/values attentions to speed up decoding
|
|
118
|
+
*/
|
|
119
|
+
use_cache?: boolean;
|
|
120
|
+
[property: string]: unknown;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Controls the stopping condition for beam-based methods.
|
|
124
|
+
*/
|
|
125
|
+
export type EarlyStoppingUnion = boolean | "never";
|
|
126
|
+
/**
|
|
127
|
+
* Outputs for Text to Speech inference
|
|
128
|
+
*
|
|
129
|
+
* Outputs of inference for the Text To Audio task
|
|
130
|
+
*/
|
|
131
|
+
export interface TextToSpeechOutput {
|
|
132
|
+
/**
|
|
133
|
+
* The generated audio waveform.
|
|
134
|
+
*/
|
|
135
|
+
audio: unknown;
|
|
136
|
+
samplingRate: unknown;
|
|
137
|
+
/**
|
|
138
|
+
* The sampling rate of the generated audio waveform.
|
|
139
|
+
*/
|
|
140
|
+
sampling_rate?: number;
|
|
141
|
+
[property: string]: unknown;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-speech/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text-to-video/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAiGf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Text2text Generation inference
|
|
8
|
+
*/
|
|
9
|
+
export interface Text2TextGenerationInput {
|
|
10
|
+
/**
|
|
11
|
+
* The input text data
|
|
12
|
+
*/
|
|
13
|
+
inputs: string;
|
|
14
|
+
/**
|
|
15
|
+
* Additional inference parameters
|
|
16
|
+
*/
|
|
17
|
+
parameters?: Text2TextGenerationParameters;
|
|
18
|
+
[property: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Text2text Generation
|
|
24
|
+
*/
|
|
25
|
+
export interface Text2TextGenerationParameters {
|
|
26
|
+
/**
|
|
27
|
+
* Whether to clean up the potential extra spaces in the text output.
|
|
28
|
+
*/
|
|
29
|
+
clean_up_tokenization_spaces?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Additional parametrization of the text generation algorithm
|
|
32
|
+
*/
|
|
33
|
+
generate_parameters?: {
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The truncation strategy to use
|
|
38
|
+
*/
|
|
39
|
+
truncation?: Text2TextGenerationTruncationStrategy;
|
|
40
|
+
[property: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
export type Text2TextGenerationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";
|
|
43
|
+
/**
|
|
44
|
+
* Outputs of inference for the Text2text Generation task
|
|
45
|
+
*/
|
|
46
|
+
export interface Text2TextGenerationOutput {
|
|
47
|
+
generatedText: unknown;
|
|
48
|
+
/**
|
|
49
|
+
* The generated text.
|
|
50
|
+
*/
|
|
51
|
+
generated_text?: string;
|
|
52
|
+
[property: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/text2text-generation/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACjD;;OAEG;IACH,UAAU,CAAC,EAAE,qCAAqC,CAAC;IACnD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,qCAAqC,GAAG,iBAAiB,GAAG,eAAe,GAAG,YAAY,GAAG,aAAa,CAAC;AAEvH;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/token-classification/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cA+Ef,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Token Classification inference
|
|
8
|
+
*/
|
|
9
|
+
export interface TokenClassificationInput {
|
|
10
|
+
/**
|
|
11
|
+
* The input text data
|
|
12
|
+
*/
|
|
13
|
+
inputs: string;
|
|
14
|
+
/**
|
|
15
|
+
* Additional inference parameters
|
|
16
|
+
*/
|
|
17
|
+
parameters?: TokenClassificationParameters;
|
|
18
|
+
[property: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Additional inference parameters
|
|
22
|
+
*
|
|
23
|
+
* Additional inference parameters for Token Classification
|
|
24
|
+
*/
|
|
25
|
+
export interface TokenClassificationParameters {
|
|
26
|
+
/**
|
|
27
|
+
* The strategy used to fuse tokens based on model predictions
|
|
28
|
+
*/
|
|
29
|
+
aggregation_strategy?: TokenClassificationAggregationStrategy;
|
|
30
|
+
/**
|
|
31
|
+
* A list of labels to ignore
|
|
32
|
+
*/
|
|
33
|
+
ignore_labels?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* The number of overlapping tokens between chunks when splitting the input text.
|
|
36
|
+
*/
|
|
37
|
+
stride?: number;
|
|
38
|
+
[property: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Do not aggregate tokens
|
|
42
|
+
*
|
|
43
|
+
* Group consecutive tokens with the same label in a single entity.
|
|
44
|
+
*
|
|
45
|
+
* Similar to "simple", also preserves word integrity (use the label predicted for the first
|
|
46
|
+
* token in a word).
|
|
47
|
+
*
|
|
48
|
+
* Similar to "simple", also preserves word integrity (uses the label with the highest
|
|
49
|
+
* score, averaged across the word's tokens).
|
|
50
|
+
*
|
|
51
|
+
* Similar to "simple", also preserves word integrity (uses the label with the highest score
|
|
52
|
+
* across the word's tokens).
|
|
53
|
+
*/
|
|
54
|
+
export type TokenClassificationAggregationStrategy = "none" | "simple" | "first" | "average" | "max";
|
|
55
|
+
export type TokenClassificationOutput = TokenClassificationOutputElement[];
|
|
56
|
+
/**
|
|
57
|
+
* Outputs of inference for the Token Classification task
|
|
58
|
+
*/
|
|
59
|
+
export interface TokenClassificationOutputElement {
|
|
60
|
+
/**
|
|
61
|
+
* The character position in the input where this group ends.
|
|
62
|
+
*/
|
|
63
|
+
end?: number;
|
|
64
|
+
/**
|
|
65
|
+
* The predicted label for that group of tokens
|
|
66
|
+
*/
|
|
67
|
+
entity_group?: string;
|
|
68
|
+
label: unknown;
|
|
69
|
+
/**
|
|
70
|
+
* The associated score / probability
|
|
71
|
+
*/
|
|
72
|
+
score: number;
|
|
73
|
+
/**
|
|
74
|
+
* The character position in the input where this group begins.
|
|
75
|
+
*/
|
|
76
|
+
start?: number;
|
|
77
|
+
/**
|
|
78
|
+
* The corresponding text
|
|
79
|
+
*/
|
|
80
|
+
word?: string;
|
|
81
|
+
[property: string]: unknown;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/token-classification/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,oBAAoB,CAAC,EAAE,sCAAsC,CAAC;IAC9D;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AACD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,sCAAsC,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;AACrG,MAAM,MAAM,yBAAyB,GAAG,gCAAgC,EAAE,CAAC;AAC3E;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/translation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAgEf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inference code generated from the JSON schema spec in ./spec
|
|
3
|
+
*
|
|
4
|
+
* Using src/scripts/inference-codegen
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for Translation inference
|
|
8
|
+
*
|
|
9
|
+
* Inputs for Text2text Generation inference
|
|
10
|
+
*/
|
|
11
|
+
export interface TranslationInput {
|
|
12
|
+
/**
|
|
13
|
+
* The input text data
|
|
14
|
+
*/
|
|
15
|
+
inputs: string;
|
|
16
|
+
/**
|
|
17
|
+
* Additional inference parameters
|
|
18
|
+
*/
|
|
19
|
+
parameters?: Text2TextGenerationParameters;
|
|
20
|
+
[property: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Additional inference parameters
|
|
24
|
+
*
|
|
25
|
+
* Additional inference parameters for Text2text Generation
|
|
26
|
+
*/
|
|
27
|
+
export interface Text2TextGenerationParameters {
|
|
28
|
+
/**
|
|
29
|
+
* Whether to clean up the potential extra spaces in the text output.
|
|
30
|
+
*/
|
|
31
|
+
clean_up_tokenization_spaces?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Additional parametrization of the text generation algorithm
|
|
34
|
+
*/
|
|
35
|
+
generate_parameters?: {
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The truncation strategy to use
|
|
40
|
+
*/
|
|
41
|
+
truncation?: Text2TextGenerationTruncationStrategy;
|
|
42
|
+
[property: string]: unknown;
|
|
43
|
+
}
|
|
44
|
+
export type Text2TextGenerationTruncationStrategy = "do_not_truncate" | "longest_first" | "only_first" | "only_second";
|
|
45
|
+
/**
|
|
46
|
+
* Outputs of inference for the Translation task
|
|
47
|
+
*/
|
|
48
|
+
export interface TranslationOutput {
|
|
49
|
+
/**
|
|
50
|
+
* The translated text.
|
|
51
|
+
*/
|
|
52
|
+
translation_text: string;
|
|
53
|
+
[property: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../../../src/tasks/translation/inference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,6BAA6B,CAAC;IAC3C,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC;;OAEG;IACH,mBAAmB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACjD;;OAEG;IACH,UAAU,CAAC,EAAE,qCAAqC,CAAC;IACnD,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,qCAAqC,GAAG,iBAAiB,GAAG,eAAe,GAAG,YAAY,GAAG,aAAa,CAAC;AAEvH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/unconditional-image-generation/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cAmEf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/tasks/video-classification/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,cA+Ef,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|