Skip to content

Commit

Permalink
Improve VLChatProcessor processor types
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova committed Nov 14, 2024
1 parent a4ecf08 commit 29097c0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/models/janus/processing_janus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<VLCChatProcessorResult | VLCChatProcessorResult & import('../../base/image_processors_utils.js').ImageProcessorResult>} The processed input.
*/
async _call(conversation, {
images = null,
Expand Down

0 comments on commit 29097c0

Please sign in to comment.