From 29097c04a71f8d85f406042154eaed104f502f63 Mon Sep 17 00:00:00 2001 From: Joshua Lochner Date: Thu, 14 Nov 2024 15:05:24 +0000 Subject: [PATCH] Improve `VLChatProcessor` processor types --- src/models/janus/processing_janus.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/models/janus/processing_janus.js b/src/models/janus/processing_janus.js index 434192e18..48b9bb4dd 100644 --- a/src/models/janus/processing_janus.js +++ b/src/models/janus/processing_janus.js @@ -26,12 +26,20 @@ export class VLChatProcessor extends Processor { * @typedef {(import('../../tokenizers.js').Message & MultimodalMessageProperties)[]} MultimodalConversation The conversation possibly containing multimodal inputs. */ + /** + * @typedef {Object} VLCChatProcessorResult The processed input. + * @property {Tensor} input_ids The input IDs. + * @property {Tensor} attention_mask The attention mask. + * @property {Tensor} images_seq_mask The image sequence mask. + * @property {Tensor} images_emb_mask The image embedding mask. + */ + /** * @param {MultimodalConversation} conversation The chat messages to process. * @param {Object} options Additional options for processing. * @param {RawImage|RawImage[]} [options.images] The images to process, if not set in the conversation. * @param {string} [options.chat_template="default"] The chat template to use. - * @returns {Promise<{input_ids: Tensor; attention_mask: Tensor; images_seq_mask: Tensor; images_emb_mask: Tensor;} & import('../../base/image_processors_utils.js').ImageProcessorResult>} The processed input. + * @returns {Promise} The processed input. */ async _call(conversation, { images = null,