@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.
- package/README.md +1 -1
- package/dist/index.cjs +3136 -3085
- package/dist/index.d.ts +425 -64
- package/dist/index.js +3135 -3084
- package/package.json +1 -1
- package/src/index.ts +2 -5
- package/src/library-to-tasks.ts +1 -1
- package/src/model-libraries-downloads.ts +20 -0
- package/src/{library-ui-elements.ts → model-libraries-snippets.ts} +46 -292
- package/src/model-libraries.ts +375 -44
- package/src/tasks/audio-classification/inference.ts +4 -4
- package/src/tasks/audio-classification/spec/input.json +4 -4
- package/src/tasks/audio-classification/spec/output.json +1 -12
- package/src/tasks/automatic-speech-recognition/inference.ts +35 -30
- package/src/tasks/automatic-speech-recognition/spec/input.json +3 -3
- package/src/tasks/automatic-speech-recognition/spec/output.json +30 -28
- package/src/tasks/common-definitions.json +25 -17
- package/src/tasks/depth-estimation/inference.ts +10 -10
- package/src/tasks/depth-estimation/spec/input.json +3 -8
- package/src/tasks/depth-estimation/spec/output.json +9 -3
- package/src/tasks/document-question-answering/inference.ts +16 -8
- package/src/tasks/document-question-answering/spec/input.json +9 -9
- package/src/tasks/document-question-answering/spec/output.json +2 -2
- package/src/tasks/feature-extraction/inference.ts +1 -1
- package/src/tasks/feature-extraction/spec/input.json +2 -2
- package/src/tasks/fill-mask/inference.ts +4 -3
- package/src/tasks/fill-mask/spec/input.json +3 -3
- package/src/tasks/fill-mask/spec/output.json +1 -1
- package/src/tasks/image-classification/inference.ts +3 -3
- package/src/tasks/image-classification/spec/input.json +4 -4
- package/src/tasks/image-segmentation/inference.ts +3 -3
- package/src/tasks/image-segmentation/spec/input.json +4 -4
- package/src/tasks/image-to-image/inference.ts +5 -5
- package/src/tasks/image-to-image/spec/input.json +9 -7
- package/src/tasks/image-to-text/inference.ts +25 -20
- package/src/tasks/image-to-text/spec/input.json +3 -3
- package/src/tasks/image-to-text/spec/output.json +8 -11
- package/src/tasks/object-detection/inference.ts +1 -1
- package/src/tasks/object-detection/spec/input.json +2 -2
- package/src/tasks/placeholder/spec/input.json +4 -4
- package/src/tasks/placeholder/spec/output.json +1 -1
- package/src/tasks/question-answering/inference.ts +8 -8
- package/src/tasks/question-answering/spec/input.json +9 -9
- package/src/tasks/sentence-similarity/inference.ts +1 -1
- package/src/tasks/sentence-similarity/spec/input.json +2 -2
- package/src/tasks/summarization/inference.ts +5 -4
- package/src/tasks/table-question-answering/inference.ts +1 -1
- package/src/tasks/table-question-answering/spec/input.json +8 -3
- package/src/tasks/text-classification/inference.ts +3 -3
- package/src/tasks/text-classification/spec/input.json +4 -4
- package/src/tasks/text-generation/inference.ts +123 -14
- package/src/tasks/text-generation/spec/input.json +28 -12
- package/src/tasks/text-generation/spec/output.json +112 -9
- package/src/tasks/text-to-audio/inference.ts +24 -19
- package/src/tasks/text-to-audio/spec/input.json +2 -2
- package/src/tasks/text-to-audio/spec/output.json +10 -13
- package/src/tasks/text-to-image/inference.ts +6 -8
- package/src/tasks/text-to-image/spec/input.json +9 -7
- package/src/tasks/text-to-image/spec/output.json +7 -9
- package/src/tasks/text-to-speech/inference.ts +18 -17
- package/src/tasks/text2text-generation/inference.ts +10 -8
- package/src/tasks/text2text-generation/spec/input.json +4 -4
- package/src/tasks/text2text-generation/spec/output.json +8 -11
- package/src/tasks/token-classification/inference.ts +4 -4
- package/src/tasks/token-classification/spec/input.json +4 -4
- package/src/tasks/token-classification/spec/output.json +1 -1
- package/src/tasks/translation/inference.ts +5 -4
- package/src/tasks/video-classification/inference.ts +5 -5
- package/src/tasks/video-classification/spec/input.json +6 -6
- package/src/tasks/visual-question-answering/inference.ts +2 -2
- package/src/tasks/visual-question-answering/spec/input.json +3 -3
- package/src/tasks/zero-shot-classification/inference.ts +3 -3
- package/src/tasks/zero-shot-classification/spec/input.json +4 -4
- package/src/tasks/zero-shot-image-classification/inference.ts +2 -2
- package/src/tasks/zero-shot-image-classification/spec/input.json +3 -3
- package/src/tasks/zero-shot-object-detection/inference.ts +1 -1
- package/src/tasks/zero-shot-object-detection/spec/input.json +2 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"title": "AutomaticSpeechRecognitionInput",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"inputs": {
|
|
9
9
|
"description": "The input audio data"
|
|
10
10
|
},
|
|
11
11
|
"parameters": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"description": "Additional inference parameters for Automatic Speech Recognition",
|
|
20
20
|
"type": "object",
|
|
21
21
|
"properties": {
|
|
22
|
-
"
|
|
22
|
+
"return_timestamps": {
|
|
23
23
|
"type": "boolean",
|
|
24
24
|
"description": "Whether to output corresponding timestamps with the generated text"
|
|
25
25
|
},
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
"required": ["
|
|
33
|
+
"required": ["inputs"]
|
|
34
34
|
}
|
|
@@ -3,34 +3,36 @@
|
|
|
3
3
|
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
4
4
|
"description": "Outputs of inference for the Automatic Speech Recognition task",
|
|
5
5
|
"title": "AutomaticSpeechRecognitionOutput",
|
|
6
|
-
"type": "
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"timestamps": {
|
|
23
|
-
"type": "array",
|
|
24
|
-
"description": "The start and end timestamps corresponding with the text",
|
|
25
|
-
"items": { "type": "number" },
|
|
26
|
-
"minLength": 2,
|
|
27
|
-
"maxLength": 2
|
|
28
|
-
}
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"text": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The recognized text."
|
|
11
|
+
},
|
|
12
|
+
"chunks": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"description": "When returnTimestamps is enabled, chunks contains a list of audio chunks identified by the model.",
|
|
15
|
+
"items": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"title": "AutomaticSpeechRecognitionOutputChunk",
|
|
18
|
+
"properties": {
|
|
19
|
+
"text": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "A chunk of text identified by the model"
|
|
29
22
|
},
|
|
30
|
-
"
|
|
31
|
-
|
|
23
|
+
"timestamps": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"description": "The start and end timestamps corresponding with the text",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "number"
|
|
28
|
+
},
|
|
29
|
+
"minLength": 2,
|
|
30
|
+
"maxLength": 2
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"required": ["text", "timestamps"]
|
|
32
34
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"required": ["text"]
|
|
36
38
|
}
|
|
@@ -43,63 +43,71 @@
|
|
|
43
43
|
"type": "number",
|
|
44
44
|
"description": "The value used to modulate the next token probabilities."
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"top_k": {
|
|
47
47
|
"type": "integer",
|
|
48
48
|
"description": "The number of highest probability vocabulary tokens to keep for top-k-filtering."
|
|
49
49
|
},
|
|
50
|
-
"
|
|
50
|
+
"top_p": {
|
|
51
51
|
"type": "number",
|
|
52
52
|
"description": "If set to float < 1, only the smallest set of most probable tokens with probabilities that add up to top_p or higher are kept for generation."
|
|
53
53
|
},
|
|
54
|
-
"
|
|
54
|
+
"typical_p": {
|
|
55
55
|
"type": "number",
|
|
56
56
|
"description": " Local typicality measures how similar the conditional probability of predicting a target token next is to the expected conditional probability of predicting a random token next, given the partial text already generated. If set to float < 1, the smallest set of the most locally typical tokens with probabilities that add up to typical_p or higher are kept for generation. See [this paper](https://hf.co/papers/2202.00666) for more details."
|
|
57
57
|
},
|
|
58
|
-
"
|
|
58
|
+
"epsilon_cutoff": {
|
|
59
59
|
"type": "number",
|
|
60
60
|
"description": "If set to float strictly between 0 and 1, only tokens with a conditional probability greater than epsilon_cutoff will be sampled. In the paper, suggested values range from 3e-4 to 9e-4, depending on the size of the model. See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191) for more details."
|
|
61
61
|
},
|
|
62
|
-
"
|
|
62
|
+
"eta_cutoff": {
|
|
63
63
|
"type": "number",
|
|
64
64
|
"description": "Eta sampling is a hybrid of locally typical sampling and epsilon sampling. If set to float strictly between 0 and 1, a token is only considered if it is greater than either eta_cutoff or sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits))). The latter term is intuitively the expected next token probability, scaled by sqrt(eta_cutoff). In the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model. See [Truncation Sampling as Language Model Desmoothing](https://hf.co/papers/2210.15191) for more details."
|
|
65
65
|
},
|
|
66
|
-
"
|
|
66
|
+
"max_length": {
|
|
67
67
|
"type": "integer",
|
|
68
68
|
"description": "The maximum length (in tokens) of the generated text, including the input."
|
|
69
69
|
},
|
|
70
|
-
"
|
|
70
|
+
"max_new_tokens": {
|
|
71
71
|
"type": "integer",
|
|
72
72
|
"description": "The maximum number of tokens to generate. Takes precedence over maxLength."
|
|
73
73
|
},
|
|
74
|
-
"
|
|
74
|
+
"min_length": {
|
|
75
75
|
"type": "integer",
|
|
76
76
|
"description": "The minimum length (in tokens) of the generated text, including the input."
|
|
77
77
|
},
|
|
78
|
-
"
|
|
78
|
+
"min_new_tokens": {
|
|
79
79
|
"type": "integer",
|
|
80
80
|
"description": "The minimum number of tokens to generate. Takes precedence over maxLength."
|
|
81
81
|
},
|
|
82
|
-
"
|
|
82
|
+
"do_sample": {
|
|
83
83
|
"type": "boolean",
|
|
84
84
|
"description": "Whether to use sampling instead of greedy decoding when generating new tokens."
|
|
85
85
|
},
|
|
86
|
-
"
|
|
86
|
+
"early_stopping": {
|
|
87
87
|
"description": "Controls the stopping condition for beam-based methods.",
|
|
88
|
-
"oneOf": [
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
"oneOf": [
|
|
89
|
+
{
|
|
90
|
+
"type": "boolean"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"const": "never",
|
|
94
|
+
"type": "string"
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"num_beams": {
|
|
91
99
|
"type": "integer",
|
|
92
100
|
"description": "Number of beams to use for beam search."
|
|
93
101
|
},
|
|
94
|
-
"
|
|
102
|
+
"num_beam_groups": {
|
|
95
103
|
"type": "integer",
|
|
96
104
|
"description": "Number of groups to divide num_beams into in order to ensure diversity among different groups of beams. See [this paper](https://hf.co/papers/1610.02424) for more details."
|
|
97
105
|
},
|
|
98
|
-
"
|
|
106
|
+
"penalty_alpha": {
|
|
99
107
|
"type": "number",
|
|
100
108
|
"description": "The value balances the model confidence and the degeneration penalty in contrastive search decoding."
|
|
101
109
|
},
|
|
102
|
-
"
|
|
110
|
+
"use_cache": {
|
|
103
111
|
"type": "boolean",
|
|
104
112
|
"description": "Whether the model should use the past last key/values attentions to speed up decoding"
|
|
105
113
|
}
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* Using src/scripts/inference-codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
export type DepthEstimationOutput = unknown[];
|
|
8
|
-
|
|
9
7
|
/**
|
|
10
8
|
* Inputs for Depth Estimation inference
|
|
11
9
|
*/
|
|
@@ -13,23 +11,25 @@ export interface DepthEstimationInput {
|
|
|
13
11
|
/**
|
|
14
12
|
* The input image data
|
|
15
13
|
*/
|
|
16
|
-
|
|
14
|
+
inputs: unknown;
|
|
17
15
|
/**
|
|
18
16
|
* Additional inference parameters
|
|
19
17
|
*/
|
|
20
|
-
parameters?:
|
|
18
|
+
parameters?: { [key: string]: unknown };
|
|
21
19
|
[property: string]: unknown;
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* Additional inference parameters for Depth Estimation
|
|
23
|
+
* Outputs of inference for the Depth Estimation task
|
|
28
24
|
*/
|
|
29
|
-
export interface
|
|
25
|
+
export interface DepthEstimationOutput {
|
|
26
|
+
/**
|
|
27
|
+
* The predicted depth as an image
|
|
28
|
+
*/
|
|
29
|
+
depth?: unknown;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* The predicted depth as a tensor
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
predicted_depth?: unknown;
|
|
34
34
|
[property: string]: unknown;
|
|
35
35
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"title": "DepthEstimationInput",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"inputs": {
|
|
9
9
|
"description": "The input image data"
|
|
10
10
|
},
|
|
11
11
|
"parameters": {
|
|
@@ -18,13 +18,8 @@
|
|
|
18
18
|
"title": "DepthEstimationParameters",
|
|
19
19
|
"description": "Additional inference parameters for Depth Estimation",
|
|
20
20
|
"type": "object",
|
|
21
|
-
"properties": {
|
|
22
|
-
"topK": {
|
|
23
|
-
"type": "integer",
|
|
24
|
-
"description": "When specified, limits the output to the top K most probable classes."
|
|
25
|
-
}
|
|
26
|
-
}
|
|
21
|
+
"properties": {}
|
|
27
22
|
}
|
|
28
23
|
},
|
|
29
|
-
"required": ["
|
|
24
|
+
"required": ["inputs"]
|
|
30
25
|
}
|
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
4
4
|
"description": "Outputs of inference for the Depth Estimation task",
|
|
5
5
|
"title": "DepthEstimationOutput",
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"predicted_depth": {
|
|
10
|
+
"description": "The predicted depth as a tensor"
|
|
11
|
+
},
|
|
12
|
+
"depth": {
|
|
13
|
+
"description": "The predicted depth as an image"
|
|
14
|
+
}
|
|
9
15
|
}
|
|
10
16
|
}
|
|
@@ -10,7 +10,7 @@ export interface DocumentQuestionAnsweringInput {
|
|
|
10
10
|
/**
|
|
11
11
|
* One (document, question) pair to answer
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
inputs: DocumentQuestionAnsweringInputData;
|
|
14
14
|
/**
|
|
15
15
|
* Additional inference parameters
|
|
16
16
|
*/
|
|
@@ -42,11 +42,11 @@ export interface DocumentQuestionAnsweringParameters {
|
|
|
42
42
|
* be split in several chunks with some overlap. This argument controls the size of that
|
|
43
43
|
* overlap.
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
doc_stride?: number;
|
|
46
46
|
/**
|
|
47
47
|
* Whether to accept impossible as an answer
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
handle_impossible_answer?: boolean;
|
|
50
50
|
/**
|
|
51
51
|
* Language to use while running OCR. Defaults to english.
|
|
52
52
|
*/
|
|
@@ -55,27 +55,27 @@ export interface DocumentQuestionAnsweringParameters {
|
|
|
55
55
|
* The maximum length of predicted answers (e.g., only answers with a shorter length are
|
|
56
56
|
* considered).
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
max_answer_len?: number;
|
|
59
59
|
/**
|
|
60
60
|
* The maximum length of the question after tokenization. It will be truncated if needed.
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
max_question_len?: number;
|
|
63
63
|
/**
|
|
64
64
|
* The maximum length of the total sentence (context + question) in tokens of each chunk
|
|
65
65
|
* passed to the model. The context will be split in several chunks (using doc_stride as
|
|
66
66
|
* overlap) if needed.
|
|
67
67
|
*/
|
|
68
|
-
|
|
68
|
+
max_seq_len?: number;
|
|
69
69
|
/**
|
|
70
70
|
* The number of answers to return (will be chosen by order of likelihood). Can return less
|
|
71
71
|
* than top_k answers if there are not enough options available within the context.
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
top_k?: number;
|
|
74
74
|
/**
|
|
75
75
|
* A list of words and bounding boxes (normalized 0->1000). If provided, the inference will
|
|
76
76
|
* skip the OCR step and use the provided bounding boxes instead.
|
|
77
77
|
*/
|
|
78
|
-
|
|
78
|
+
word_boxes?: WordBox[];
|
|
79
79
|
[property: string]: unknown;
|
|
80
80
|
}
|
|
81
81
|
export type WordBox = number[] | string;
|
|
@@ -88,11 +88,19 @@ export interface DocumentQuestionAnsweringOutputElement {
|
|
|
88
88
|
* The answer to the question.
|
|
89
89
|
*/
|
|
90
90
|
answer: string;
|
|
91
|
+
/**
|
|
92
|
+
* The end word index of the answer (in the OCR’d version of the input or provided word
|
|
93
|
+
* boxes).
|
|
94
|
+
*/
|
|
91
95
|
end: number;
|
|
92
96
|
/**
|
|
93
97
|
* The probability associated to the answer.
|
|
94
98
|
*/
|
|
95
99
|
score: number;
|
|
100
|
+
/**
|
|
101
|
+
* The start word index of the answer (in the OCR’d version of the input or provided word
|
|
102
|
+
* boxes).
|
|
103
|
+
*/
|
|
96
104
|
start: number;
|
|
97
105
|
/**
|
|
98
106
|
* The index of each word/box pair that is in the answer
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"title": "DocumentQuestionAnsweringInput",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"inputs": {
|
|
9
9
|
"description": "One (document, question) pair to answer",
|
|
10
10
|
"type": "object",
|
|
11
11
|
"title": "DocumentQuestionAnsweringInputData",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"description": "Additional inference parameters for Document Question Answering",
|
|
32
32
|
"type": "object",
|
|
33
33
|
"properties": {
|
|
34
|
-
"
|
|
34
|
+
"doc_stride": {
|
|
35
35
|
"type": "integer",
|
|
36
36
|
"description": "If the words in the document are too long to fit with the question for the model, it will be split in several chunks with some overlap. This argument controls the size of that overlap."
|
|
37
37
|
},
|
|
38
|
-
"
|
|
38
|
+
"handle_impossible_answer": {
|
|
39
39
|
"type": "boolean",
|
|
40
40
|
"description": "Whether to accept impossible as an answer"
|
|
41
41
|
},
|
|
@@ -43,23 +43,23 @@
|
|
|
43
43
|
"type": "string",
|
|
44
44
|
"description": "Language to use while running OCR. Defaults to english."
|
|
45
45
|
},
|
|
46
|
-
"
|
|
46
|
+
"max_answer_len": {
|
|
47
47
|
"type": "integer",
|
|
48
48
|
"description": "The maximum length of predicted answers (e.g., only answers with a shorter length are considered)."
|
|
49
49
|
},
|
|
50
|
-
"
|
|
50
|
+
"max_seq_len": {
|
|
51
51
|
"type": "integer",
|
|
52
52
|
"description": "The maximum length of the total sentence (context + question) in tokens of each chunk passed to the model. The context will be split in several chunks (using doc_stride as overlap) if needed."
|
|
53
53
|
},
|
|
54
|
-
"
|
|
54
|
+
"max_question_len": {
|
|
55
55
|
"type": "integer",
|
|
56
56
|
"description": "The maximum length of the question after tokenization. It will be truncated if needed."
|
|
57
57
|
},
|
|
58
|
-
"
|
|
58
|
+
"top_k": {
|
|
59
59
|
"type": "integer",
|
|
60
60
|
"description": "The number of answers to return (will be chosen by order of likelihood). Can return less than top_k answers if there are not enough options available within the context."
|
|
61
61
|
},
|
|
62
|
-
"
|
|
62
|
+
"word_boxes": {
|
|
63
63
|
"type": "array",
|
|
64
64
|
"description": "A list of words and bounding boxes (normalized 0->1000). If provided, the inference will skip the OCR step and use the provided bounding boxes instead.",
|
|
65
65
|
"items": {
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
-
"required": ["
|
|
84
|
+
"required": ["inputs"]
|
|
85
85
|
}
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
},
|
|
18
18
|
"start": {
|
|
19
19
|
"type": "integer",
|
|
20
|
-
"
|
|
20
|
+
"description": "The start word index of the answer (in the OCR\u2019d version of the input or provided word boxes)."
|
|
21
21
|
},
|
|
22
22
|
"end": {
|
|
23
23
|
"type": "integer",
|
|
24
|
-
"
|
|
24
|
+
"description": "The end word index of the answer (in the OCR\u2019d version of the input or provided word boxes)."
|
|
25
25
|
},
|
|
26
26
|
"words": {
|
|
27
27
|
"type": "array",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"title": "FeatureExtractionInput",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"inputs": {
|
|
9
9
|
"description": "The text to get the embeddings of",
|
|
10
10
|
"type": "string"
|
|
11
11
|
},
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"properties": {}
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
"required": ["
|
|
25
|
+
"required": ["inputs"]
|
|
26
26
|
}
|
|
@@ -10,7 +10,7 @@ export interface FillMaskInput {
|
|
|
10
10
|
/**
|
|
11
11
|
* The text with masked tokens
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
inputs: string;
|
|
14
14
|
/**
|
|
15
15
|
* Additional inference parameters
|
|
16
16
|
*/
|
|
@@ -33,7 +33,7 @@ export interface FillMaskParameters {
|
|
|
33
33
|
/**
|
|
34
34
|
* When passed, overrides the number of predictions to return.
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
top_k?: number;
|
|
37
37
|
[property: string]: unknown;
|
|
38
38
|
}
|
|
39
39
|
export type FillMaskOutput = FillMaskOutputElement[];
|
|
@@ -53,9 +53,10 @@ export interface FillMaskOutputElement {
|
|
|
53
53
|
* The predicted token id (to replace the masked one).
|
|
54
54
|
*/
|
|
55
55
|
token: number;
|
|
56
|
+
tokenStr: unknown;
|
|
56
57
|
/**
|
|
57
58
|
* The predicted token (to replace the masked one).
|
|
58
59
|
*/
|
|
59
|
-
|
|
60
|
+
token_str?: string;
|
|
60
61
|
[property: string]: unknown;
|
|
61
62
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"title": "FillMaskInput",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"inputs": {
|
|
9
9
|
"description": "The text with masked tokens",
|
|
10
10
|
"type": "string"
|
|
11
11
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"description": "Additional inference parameters for Fill Mask",
|
|
21
21
|
"type": "object",
|
|
22
22
|
"properties": {
|
|
23
|
-
"
|
|
23
|
+
"top_k": {
|
|
24
24
|
"type": "integer",
|
|
25
25
|
"description": "When passed, overrides the number of predictions to return."
|
|
26
26
|
},
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
"required": ["
|
|
37
|
+
"required": ["inputs"]
|
|
38
38
|
}
|
|
@@ -10,7 +10,7 @@ export interface ImageClassificationInput {
|
|
|
10
10
|
/**
|
|
11
11
|
* The input image data
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
inputs: unknown;
|
|
14
14
|
/**
|
|
15
15
|
* Additional inference parameters
|
|
16
16
|
*/
|
|
@@ -23,11 +23,11 @@ export interface ImageClassificationInput {
|
|
|
23
23
|
* Additional inference parameters for Image Classification
|
|
24
24
|
*/
|
|
25
25
|
export interface ImageClassificationParameters {
|
|
26
|
-
|
|
26
|
+
function_to_apply?: ClassificationOutputTransform;
|
|
27
27
|
/**
|
|
28
28
|
* When specified, limits the output to the top K most probable classes.
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
top_k?: number;
|
|
31
31
|
[property: string]: unknown;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"title": "ImageClassificationInput",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"inputs": {
|
|
9
9
|
"description": "The input image data"
|
|
10
10
|
},
|
|
11
11
|
"parameters": {
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
"description": "Additional inference parameters for Image Classification",
|
|
20
20
|
"type": "object",
|
|
21
21
|
"properties": {
|
|
22
|
-
"
|
|
22
|
+
"function_to_apply": {
|
|
23
23
|
"title": "ImageClassificationOutputTransform",
|
|
24
24
|
"$ref": "/inference/schemas/common-definitions.json#/definitions/ClassificationOutputTransform"
|
|
25
25
|
},
|
|
26
|
-
"
|
|
26
|
+
"top_k": {
|
|
27
27
|
"type": "integer",
|
|
28
28
|
"description": "When specified, limits the output to the top K most probable classes."
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
"required": ["
|
|
33
|
+
"required": ["inputs"]
|
|
34
34
|
}
|
|
@@ -10,7 +10,7 @@ export interface ImageSegmentationInput {
|
|
|
10
10
|
/**
|
|
11
11
|
* The input image data
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
inputs: unknown;
|
|
14
14
|
/**
|
|
15
15
|
* Additional inference parameters
|
|
16
16
|
*/
|
|
@@ -26,11 +26,11 @@ export interface ImageSegmentationParameters {
|
|
|
26
26
|
/**
|
|
27
27
|
* Threshold to use when turning the predicted masks into binary values.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
mask_threshold?: number;
|
|
30
30
|
/**
|
|
31
31
|
* Mask overlap threshold to eliminate small, disconnected segments.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
overlap_mask_area_threshold?: number;
|
|
34
34
|
/**
|
|
35
35
|
* Segmentation task to be performed, depending on model capabilities.
|
|
36
36
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"title": "ImageSegmentationInput",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
-
"
|
|
8
|
+
"inputs": {
|
|
9
9
|
"description": "The input image data"
|
|
10
10
|
},
|
|
11
11
|
"parameters": {
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"description": "Additional inference parameters for Image Segmentation",
|
|
20
20
|
"type": "object",
|
|
21
21
|
"properties": {
|
|
22
|
-
"
|
|
22
|
+
"mask_threshold": {
|
|
23
23
|
"type": "number",
|
|
24
24
|
"description": "Threshold to use when turning the predicted masks into binary values."
|
|
25
25
|
},
|
|
26
|
-
"
|
|
26
|
+
"overlap_mask_area_threshold": {
|
|
27
27
|
"type": "number",
|
|
28
28
|
"description": "Mask overlap threshold to eliminate small, disconnected segments."
|
|
29
29
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
"required": ["
|
|
53
|
+
"required": ["inputs"]
|
|
54
54
|
}
|
|
@@ -11,7 +11,7 @@ export interface ImageToImageInput {
|
|
|
11
11
|
/**
|
|
12
12
|
* The input image data
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
inputs: unknown;
|
|
15
15
|
/**
|
|
16
16
|
* Additional inference parameters
|
|
17
17
|
*/
|
|
@@ -29,20 +29,20 @@ export interface ImageToImageParameters {
|
|
|
29
29
|
* For diffusion models. A higher guidance scale value encourages the model to generate
|
|
30
30
|
* images closely linked to the text prompt at the expense of lower image quality.
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
guidance_scale?: number;
|
|
33
33
|
/**
|
|
34
34
|
* One or several prompt to guide what NOT to include in image generation.
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
negative_prompt?: string[];
|
|
37
37
|
/**
|
|
38
38
|
* For diffusion models. The number of denoising steps. More denoising steps usually lead to
|
|
39
39
|
* a higher quality image at the expense of slower inference.
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
num_inference_steps?: number;
|
|
42
42
|
/**
|
|
43
43
|
* The size in pixel of the output image
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
target_size?: TargetSize;
|
|
46
46
|
[property: string]: unknown;
|
|
47
47
|
}
|
|
48
48
|
|