Skip to content

Commit 1b9c6e2

Browse files
committed
regenerate code
1 parent 077a88f commit 1b9c6e2

File tree

27 files changed

+909
-983
lines changed

27 files changed

+909
-983
lines changed

packages/tasks/src/tasks/audio-classification/inference.ts

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,50 @@
33
*
44
* Using src/scripts/inference-codegen
55
*/
6-
76
/**
87
* Inputs for Audio Classification inference
98
*/
109
export interface AudioClassificationInput {
11-
/**
12-
* The input audio data
13-
*/
14-
data: unknown;
15-
/**
16-
* Additional inference parameters
17-
*/
18-
parameters?: AudioClassificationParameters;
19-
[property: string]: unknown;
10+
/**
11+
* The input audio data
12+
*/
13+
data: unknown;
14+
/**
15+
* Additional inference parameters
16+
*/
17+
parameters?: AudioClassificationParameters;
18+
[property: string]: unknown;
2019
}
21-
2220
/**
2321
* Additional inference parameters
2422
*
2523
* Additional inference parameters for Audio Classification
2624
*/
2725
export interface AudioClassificationParameters {
28-
/**
29-
* The function to apply to the model outputs in order to retrieve the scores.
30-
*/
31-
functionToApply?: AudioClassificationOutputTransform;
32-
/**
33-
* When specified, limits the output to the top K most probable classes.
34-
*/
35-
topK?: number;
36-
[property: string]: unknown;
26+
/**
27+
* The function to apply to the model outputs in order to retrieve the scores.
28+
*/
29+
functionToApply?: AudioClassificationOutputTransform;
30+
/**
31+
* When specified, limits the output to the top K most probable classes.
32+
*/
33+
topK?: number;
34+
[property: string]: unknown;
3735
}
38-
3936
export type AudioClassificationOutputTransform = "sigmoid" | "softmax" | "none";
40-
37+
export type AudioClassificationOutput = AudioClassificationOutputElement[];
38+
;
4139
/**
4240
* Outputs for Audio Classification inference
4341
*/
44-
export interface AudioClassificationOutput {
45-
/**
46-
* The predicted class label (model specific).
47-
*/
48-
label: string;
49-
/**
50-
* The corresponding probability.
51-
*/
52-
score: number;
53-
[property: string]: unknown;
42+
export interface AudioClassificationOutputElement {
43+
/**
44+
* The predicted class label (model specific).
45+
*/
46+
label: string;
47+
/**
48+
* The corresponding probability.
49+
*/
50+
score: number;
51+
[property: string]: unknown;
5452
}

packages/tasks/src/tasks/automatic-speech-recognition/inference.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,31 @@
33
*
44
* Using src/scripts/inference-codegen
55
*/
6-
76
/**
87
* Inputs for Automatic Speech Recognition inference
98
*/
109
export interface AutomaticSpeechRecognitionInput {
11-
/**
12-
* The input audio data
13-
*/
14-
data: unknown;
15-
/**
16-
* Additional inference parameters
17-
*/
18-
parameters?: { [key: string]: unknown };
19-
[property: string]: unknown;
10+
/**
11+
* The input audio data
12+
*/
13+
data: unknown;
14+
/**
15+
* Additional inference parameters
16+
*/
17+
parameters?: {
18+
[key: string]: unknown;
19+
};
20+
[property: string]: unknown;
2021
}
21-
22+
export type AutomaticSpeechRecognitionOutput = AutomaticSpeechRecognitionOutputElement[];
23+
;
2224
/**
2325
* Outputs of inference for the Automatic Speech Recognition task
2426
*/
25-
export interface AutomaticSpeechRecognitionOutput {
26-
/**
27-
* The recognized text.
28-
*/
29-
text: string;
30-
[property: string]: unknown;
27+
export interface AutomaticSpeechRecognitionOutputElement {
28+
/**
29+
* The recognized text.
30+
*/
31+
text: string;
32+
[property: string]: unknown;
3133
}
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1+
12
/**
23
* Inference code generated from the JSON schema spec in ./spec
3-
*
4+
*
45
* Using src/scripts/inference-codegen
56
*/
67

8+
79
export type DepthEstimationOutput = unknown[];
810

911
/**
1012
* Inputs for Depth Estimation inference
1113
*/
1214
export interface DepthEstimationInput {
13-
/**
14-
* The input image data
15-
*/
16-
data: unknown;
17-
/**
18-
* Additional inference parameters
19-
*/
20-
parameters?: DepthEstimationParameters;
21-
[property: string]: unknown;
15+
/**
16+
* The input image data
17+
*/
18+
data: unknown;
19+
/**
20+
* Additional inference parameters
21+
*/
22+
parameters?: DepthEstimationParameters;
23+
[property: string]: unknown;
2224
}
2325

2426
/**
@@ -27,9 +29,9 @@ export interface DepthEstimationInput {
2729
* Additional inference parameters for Depth Estimation
2830
*/
2931
export interface DepthEstimationParameters {
30-
/**
31-
* When specified, limits the output to the top K most probable classes.
32-
*/
33-
topK?: number;
34-
[property: string]: unknown;
32+
/**
33+
* When specified, limits the output to the top K most probable classes.
34+
*/
35+
topK?: number;
36+
[property: string]: unknown;
3537
}

packages/tasks/src/tasks/document-question-answering/inference.ts

Lines changed: 76 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -3,104 +3,101 @@
33
*
44
* Using src/scripts/inference-codegen
55
*/
6-
76
/**
87
* Inputs for Document Question Answering inference
98
*/
109
export interface DocumentQuestionAnsweringInput {
11-
/**
12-
* One (document, question) pair to answer
13-
*/
14-
data: DocumentQuestionAnsweringInputData;
15-
/**
16-
* Additional inference parameters
17-
*/
18-
parameters?: DocumentQuestionAnsweringParameters;
19-
[property: string]: unknown;
10+
/**
11+
* One (document, question) pair to answer
12+
*/
13+
data: DocumentQuestionAnsweringInputData;
14+
/**
15+
* Additional inference parameters
16+
*/
17+
parameters?: DocumentQuestionAnsweringParameters;
18+
[property: string]: unknown;
2019
}
21-
2220
/**
2321
* One (document, question) pair to answer
2422
*/
2523
export interface DocumentQuestionAnsweringInputData {
26-
/**
27-
* The image on which the question is asked
28-
*/
29-
image: unknown;
30-
/**
31-
* A question to ask of the document
32-
*/
33-
question: string;
34-
[property: string]: unknown;
24+
/**
25+
* The image on which the question is asked
26+
*/
27+
image: unknown;
28+
/**
29+
* A question to ask of the document
30+
*/
31+
question: string;
32+
[property: string]: unknown;
3533
}
36-
3734
/**
3835
* Additional inference parameters
3936
*
4037
* Additional inference parameters for Document Question Answering
4138
*/
4239
export interface DocumentQuestionAnsweringParameters {
43-
/**
44-
* If the words in the document are too long to fit with the question for the model, it will
45-
* be split in several chunks with some overlap. This argument controls the size of that
46-
* overlap.
47-
*/
48-
docStride?: number;
49-
/**
50-
* Whether to accept impossible as an answer
51-
*/
52-
handleImpossibleAnswer?: boolean;
53-
/**
54-
* Language to use while running OCR. Defaults to english.
55-
*/
56-
lang?: string;
57-
/**
58-
* The maximum length of predicted answers (e.g., only answers with a shorter length are
59-
* considered).
60-
*/
61-
maxAnswerLen?: number;
62-
/**
63-
* The maximum length of the question after tokenization. It will be truncated if needed.
64-
*/
65-
maxQuestionLen?: number;
66-
/**
67-
* The maximum length of the total sentence (context + question) in tokens of each chunk
68-
* passed to the model. The context will be split in several chunks (using doc_stride as
69-
* overlap) if needed.
70-
*/
71-
maxSeqLen?: number;
72-
/**
73-
* The number of answers to return (will be chosen by order of likelihood). Can return less
74-
* than top_k answers if there are not enough options available within the context.
75-
*/
76-
topK?: number;
77-
/**
78-
* A list of words and bounding boxes (normalized 0->1000). If provided, the inference will
79-
* skip the OCR step and use the provided bounding boxes instead.
80-
*/
81-
wordBoxes?: WordBox[];
82-
[property: string]: unknown;
40+
/**
41+
* If the words in the document are too long to fit with the question for the model, it will
42+
* be split in several chunks with some overlap. This argument controls the size of that
43+
* overlap.
44+
*/
45+
docStride?: number;
46+
/**
47+
* Whether to accept impossible as an answer
48+
*/
49+
handleImpossibleAnswer?: boolean;
50+
/**
51+
* Language to use while running OCR. Defaults to english.
52+
*/
53+
lang?: string;
54+
/**
55+
* The maximum length of predicted answers (e.g., only answers with a shorter length are
56+
* considered).
57+
*/
58+
maxAnswerLen?: number;
59+
/**
60+
* The maximum length of the question after tokenization. It will be truncated if needed.
61+
*/
62+
maxQuestionLen?: number;
63+
/**
64+
* The maximum length of the total sentence (context + question) in tokens of each chunk
65+
* passed to the model. The context will be split in several chunks (using doc_stride as
66+
* overlap) if needed.
67+
*/
68+
maxSeqLen?: number;
69+
/**
70+
* The number of answers to return (will be chosen by order of likelihood). Can return less
71+
* than top_k answers if there are not enough options available within the context.
72+
*/
73+
topK?: number;
74+
/**
75+
* A list of words and bounding boxes (normalized 0->1000). If provided, the inference will
76+
* skip the OCR step and use the provided bounding boxes instead.
77+
*/
78+
wordBoxes?: WordBox[];
79+
[property: string]: unknown;
8380
}
84-
8581
export type WordBox = number[] | string;
86-
82+
export type DocumentQuestionAnsweringOutput = DocumentQuestionAnsweringOutputElement[];
83+
;
8784
/**
8885
* Outputs of inference for the Document Question Answering task
8986
*/
90-
export interface DocumentQuestionAnsweringOutput {
91-
/**
92-
* The answer to the question.
93-
*/
94-
answer: string;
95-
end: number;
96-
/**
97-
* The probability associated to the answer.
98-
*/
99-
score: number;
100-
start: number;
101-
/**
102-
* The index of each word/box pair that is in the answer
103-
*/
104-
words: number[];
105-
[property: string]: unknown;
87+
export interface DocumentQuestionAnsweringOutputElement {
88+
/**
89+
* The answer to the question.
90+
*/
91+
answer: string;
92+
end: number;
93+
/**
94+
* The probability associated to the answer.
95+
*/
96+
score: number;
97+
start: number;
98+
/**
99+
* The index of each word/box pair that is in the answer
100+
*/
101+
words: number[];
102+
[property: string]: unknown;
106103
}
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1+
12
/**
23
* Inference code generated from the JSON schema spec in ./spec
3-
*
4+
*
45
* Using src/scripts/inference-codegen
56
*/
67

8+
79
export type FeatureExtractionOutput = unknown[];
810

911
/**
1012
* Inputs for Text Embedding inference
1113
*/
1214
export interface FeatureExtractionInput {
13-
/**
14-
* The text to get the embeddings of
15-
*/
16-
data: string;
17-
/**
18-
* Additional inference parameters
19-
*/
20-
parameters?: { [key: string]: unknown };
21-
[property: string]: unknown;
15+
/**
16+
* The text to get the embeddings of
17+
*/
18+
data: string;
19+
/**
20+
* Additional inference parameters
21+
*/
22+
parameters?: { [key: string]: unknown };
23+
[property: string]: unknown;
2224
}

0 commit comments

Comments
 (0)