Skip to content

Commit

Permalink
💄format with pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
SBrandeis committed Jan 23, 2024
1 parent f9fd4f9 commit d4ec535
Show file tree
Hide file tree
Showing 29 changed files with 867 additions and 921 deletions.
2 changes: 1 addition & 1 deletion packages/tasks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
"@types/node": "^20.11.5",
"quicktype-core": "https://github.com/huggingface/quicktype/raw/pack-18.0.15/packages/quicktype-core/quicktype-core-18.0.15.tgz"
}
}
}
50 changes: 24 additions & 26 deletions packages/tasks/src/tasks/audio-classification/inference.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@

/**
* Inference code generated from the JSON schema spec in ./spec
*
*
* Using src/scripts/inference-codegen
*/


/**
* Inputs for Audio Classification inference
*/
export interface AudioClassificationInput {
/**
* On or several audio files to classify
*/
inputs: unknown;
/**
* Additional inference parameters
*/
parameters?: AudioClassificationParameters;
[property: string]: unknown;
/**
* On or several audio files to classify
*/
inputs: unknown;
/**
* Additional inference parameters
*/
parameters?: AudioClassificationParameters;
[property: string]: unknown;
}

/**
Expand All @@ -27,24 +25,24 @@ export interface AudioClassificationInput {
* Additional inference parameters for Audio Classification
*/
export interface AudioClassificationParameters {
/**
* When specified, limits the output to the top K most probable classes.
*/
topK?: number;
[property: string]: unknown;
/**
* When specified, limits the output to the top K most probable classes.
*/
topK?: number;
[property: string]: unknown;
}

/**
* Outputs for Audio Classification inference
*/
export interface AudioClassificationOutput {
/**
* The predicted class label (model specific).
*/
label: string;
/**
* The corresponding probability.
*/
score: number;
[property: string]: unknown;
/**
* The predicted class label (model specific).
*/
label: string;
/**
* The corresponding probability.
*/
score: number;
[property: string]: unknown;
}
32 changes: 15 additions & 17 deletions packages/tasks/src/tasks/automatic-speech-recognition/inference.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@

/**
* Inference code generated from the JSON schema spec in ./spec
*
*
* Using src/scripts/inference-codegen
*/


/**
* Inputs for Automatic Speech Recognition inference
*/
export interface AutomaticSpeechRecognitionInput {
/**
* The input audio data
*/
inputs: unknown;
/**
* Additional inference parameters
*/
parameters?: { [key: string]: unknown };
[property: string]: unknown;
/**
* The input audio data
*/
inputs: unknown;
/**
* Additional inference parameters
*/
parameters?: { [key: string]: unknown };
[property: string]: unknown;
}

/**
* Outputs of inference for the Automatic Speech Recognition task
*/
export interface AutomaticSpeechRecognitionOutput {
/**
* The recognized text.
*/
text: string;
[property: string]: unknown;
/**
* The recognized text.
*/
text: string;
[property: string]: unknown;
}
32 changes: 15 additions & 17 deletions packages/tasks/src/tasks/depth-estimation/inference.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@

/**
* Inference code generated from the JSON schema spec in ./spec
*
*
* Using src/scripts/inference-codegen
*/


export type DepthEstimationOutput = unknown[];

/**
* Inputs for Depth Estimation inference
*/
export interface DepthEstimationInput {
/**
* The input image data
*/
inputs: unknown;
/**
* Additional inference parameters
*/
parameters?: DepthEstimationParameters;
[property: string]: unknown;
/**
* The input image data
*/
inputs: unknown;
/**
* Additional inference parameters
*/
parameters?: DepthEstimationParameters;
[property: string]: unknown;
}

/**
Expand All @@ -29,9 +27,9 @@ export interface DepthEstimationInput {
* Additional inference parameters for Depth Estimation
*/
export interface DepthEstimationParameters {
/**
* When specified, limits the output to the top K most probable classes.
*/
topK?: number;
[property: string]: unknown;
/**
* When specified, limits the output to the top K most probable classes.
*/
topK?: number;
[property: string]: unknown;
}
150 changes: 74 additions & 76 deletions packages/tasks/src/tasks/document-question-answering/inference.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@

/**
* Inference code generated from the JSON schema spec in ./spec
*
*
* Using src/scripts/inference-codegen
*/


/**
* Inputs for Document Question Answering inference
*/
export interface DocumentQuestionAnsweringInput {
/**
* The
*/
inputs: DocumentQuestionAnsweringInpu[] | DocumentQuestionAnsweringInpu;
/**
* Additional inference parameters
*/
parameters?: DocumentQuestionAnsweringParameters;
[property: string]: unknown;
/**
* The
*/
inputs: DocumentQuestionAnsweringInpu[] | DocumentQuestionAnsweringInpu;
/**
* Additional inference parameters
*/
parameters?: DocumentQuestionAnsweringParameters;
[property: string]: unknown;
}

export interface DocumentQuestionAnsweringInpu {
/**
* The image on which the question is asked
*/
image?: unknown;
/**
* A question to ask of the document
*/
question?: string;
[property: string]: unknown;
/**
* The image on which the question is asked
*/
image?: unknown;
/**
* A question to ask of the document
*/
question?: string;
[property: string]: unknown;
}

/**
Expand All @@ -39,65 +37,65 @@ export interface DocumentQuestionAnsweringInpu {
* Additional inference parameters for Document Question Answering
*/
export interface DocumentQuestionAnsweringParameters {
/**
* 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.
*/
docStride?: number;
/**
* Whether to accept impossible as an answer
*/
handleImpossibleAnswer?: boolean;
/**
* Language to use while running OCR. Defaults to english.
*/
lang?: string;
/**
* The maximum length of predicted answers (e.g., only answers with a shorter length are
* considered).
*/
maxAnswerLen?: number;
/**
* The maximum length of the question after tokenization. It will be truncated if needed.
*/
maxQuestionLen?: number;
/**
* 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.
*/
maxSeqLen?: number;
/**
* 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.
*/
topK?: number;
/**
* 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.
*/
wordBoxes?: Array<number[] | string>;
[property: string]: unknown;
/**
* 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.
*/
docStride?: number;
/**
* Whether to accept impossible as an answer
*/
handleImpossibleAnswer?: boolean;
/**
* Language to use while running OCR. Defaults to english.
*/
lang?: string;
/**
* The maximum length of predicted answers (e.g., only answers with a shorter length are
* considered).
*/
maxAnswerLen?: number;
/**
* The maximum length of the question after tokenization. It will be truncated if needed.
*/
maxQuestionLen?: number;
/**
* 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.
*/
maxSeqLen?: number;
/**
* 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.
*/
topK?: number;
/**
* 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.
*/
wordBoxes?: Array<number[] | string>;
[property: string]: unknown;
}

/**
* Outputs of inference for the Document Question Answering task
*/
export interface DocumentQuestionAnsweringOutput {
/**
* The answer to the question.
*/
answer: string;
end: number;
/**
* The probability associated to the answer.
*/
score: number;
start: number;
/**
* The index of each word/box pair that is in the answer
*/
words: number[];
[property: string]: unknown;
/**
* The answer to the question.
*/
answer: string;
end: number;
/**
* The probability associated to the answer.
*/
score: number;
start: number;
/**
* The index of each word/box pair that is in the answer
*/
words: number[];
[property: string]: unknown;
}
22 changes: 10 additions & 12 deletions packages/tasks/src/tasks/feature-extraction/inference.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@

/**
* Inference code generated from the JSON schema spec in ./spec
*
*
* Using src/scripts/inference-codegen
*/


/**
* Inputs for Feature Extraction inference
*/
export interface FeatureExtractionInput {
/**
* One or several texts to get the features of
*/
inputs: string[] | string;
/**
* Additional inference parameters
*/
parameters?: { [key: string]: unknown };
[property: string]: unknown;
/**
* One or several texts to get the features of
*/
inputs: string[] | string;
/**
* Additional inference parameters
*/
parameters?: { [key: string]: unknown };
[property: string]: unknown;
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
}
]
}
}
}
Loading

0 comments on commit d4ec535

Please sign in to comment.