Record Class QwenVlProcessor.ProcessedMultimodal

java.lang.Object
java.lang.Record
smile.llm.model.qwen.QwenVlProcessor.ProcessedMultimodal
Record Components:
inputIds - expanded token ids including vision pads.
mmTokenTypeIds - 0=text, 1=image, 2=video.
pixelValues - packed patches, or null when text-only.
imageGridThw - image grids.
videoGridThw - video grids.
mrope - interleaved mRoPE planes.
Enclosing class:
QwenVlProcessor

public static record QwenVlProcessor.ProcessedMultimodal(int[] inputIds, int[] mmTokenTypeIds, Tensor pixelValues, int[][] imageGridThw, int[][] videoGridThw, InterleavedMRope.MropePositions mrope) extends Record
Result of multimodal preprocessing for one prompt.
  • Constructor Details

    • ProcessedMultimodal

      public ProcessedMultimodal(int[] inputIds, int[] mmTokenTypeIds, Tensor pixelValues, int[][] imageGridThw, int[][] videoGridThw, InterleavedMRope.MropePositions mrope)
      Creates an instance of a ProcessedMultimodal record class.
      Parameters:
      inputIds - the value for the inputIds record component
      mmTokenTypeIds - the value for the mmTokenTypeIds record component
      pixelValues - the value for the pixelValues record component
      imageGridThw - the value for the imageGridThw record component
      videoGridThw - the value for the videoGridThw record component
      mrope - the value for the mrope record component
  • Method Details

    • hasVision

      public boolean hasVision()
      Returns whether vision tensors are present.
      Returns:
      true when vision tensors are present.
    • to

      Moves pixel values to device (no-op when null).
      Parameters:
      device - target device.
      dtype - compute dtype.
      Returns:
      this, with updated pixelValues ownership transferred.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • inputIds

      public int[] inputIds()
      Returns the value of the inputIds record component.
      Returns:
      the value of the inputIds record component
    • mmTokenTypeIds

      public int[] mmTokenTypeIds()
      Returns the value of the mmTokenTypeIds record component.
      Returns:
      the value of the mmTokenTypeIds record component
    • pixelValues

      public Tensor pixelValues()
      Returns the value of the pixelValues record component.
      Returns:
      the value of the pixelValues record component
    • imageGridThw

      public int[][] imageGridThw()
      Returns the value of the imageGridThw record component.
      Returns:
      the value of the imageGridThw record component
    • videoGridThw

      public int[][] videoGridThw()
      Returns the value of the videoGridThw record component.
      Returns:
      the value of the videoGridThw record component
    • mrope

      Returns the value of the mrope record component.
      Returns:
      the value of the mrope record component