diff --git a/src/models/auto/processing_auto.js b/src/models/auto/processing_auto.js index 4f955546f..f599c9a89 100644 --- a/src/models/auto/processing_auto.js +++ b/src/models/auto/processing_auto.js @@ -8,15 +8,19 @@ import * as AllProcessors from '../processors.js'; import * as AllImageProcessors from '../image_processors.js'; import * as AllFeatureExtractors from '../feature_extractors.js'; +/** + * @typedef {import('../../base/processing_utils.js').PretrainedProcessorOptions} PretrainedProcessorOptions + */ + /** * Helper class which is used to instantiate pretrained processors with the `from_pretrained` function. * The chosen processor class is determined by the type specified in the processor config. - * + * * **Example:** Load a processor using `from_pretrained`. * ```javascript * let processor = await AutoProcessor.from_pretrained('openai/whisper-tiny.en'); * ``` - * + * * **Example:** Run an image through a processor. * ```javascript * let processor = await AutoProcessor.from_pretrained('Xenova/clip-vit-base-patch16'); diff --git a/src/models/mgp_str/processing_mgp_str.js b/src/models/mgp_str/processing_mgp_str.js index a4da992cc..4232277cb 100644 --- a/src/models/mgp_str/processing_mgp_str.js +++ b/src/models/mgp_str/processing_mgp_str.js @@ -110,7 +110,7 @@ export class MgpstrProcessor extends Processor { /** * Convert a list of lists of token ids into a list of strings by calling decode. - * @param {import('../../utils/tensor.js').Tensor[]} sequences List of tokenized input ids. + * @param {[import('../../utils/tensor.js').Tensor, import('../../utils/tensor.js').Tensor, import('../../utils/tensor.js').Tensor]} sequences List of tokenized input ids. * @returns {{generated_text: string[], scores: number[], char_preds: string[], bpe_preds: string[], wp_preds: string[]}} * Dictionary of all the outputs of the decoded results. * - generated_text: The final results after fusion of char, bpe, and wp. @@ -119,8 +119,7 @@ export class MgpstrProcessor extends Processor { * - bpe_preds: The list of BPE decoded sentences. * - wp_preds: The list of wp decoded sentences. */ - // @ts-expect-error The type of this method is not compatible with the one - // in the base class. It might be a good idea to fix this. + // @ts-expect-error The type of this method is not compatible with the one in the base class. batch_decode([char_logits, bpe_logits, wp_logits]) { const [char_preds, char_scores] = this._decode_helper(char_logits, 'char'); const [bpe_preds, bpe_scores] = this._decode_helper(bpe_logits, 'bpe'); diff --git a/tsconfig.json b/tsconfig.json index fb6de7097..793c686c2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,8 @@ "declaration": true, "declarationMap": true, "noEmit": false, - "emitDeclarationOnly": true + "emitDeclarationOnly": true, + "esModuleInterop": true }, "typeAcquisition": { "include": ["jest"]