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 Summary
ConstructorsConstructorDescriptionProcessedMultimodal(int[] inputIds, int[] mmTokenTypeIds, Tensor pixelValues, int[][] imageGridThw, int[][] videoGridThw, InterleavedMRope.MropePositions mrope) Creates an instance of aProcessedMultimodalrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns whether vision tensors are present.int[][]Returns the value of theimageGridThwrecord component.int[]inputIds()Returns the value of theinputIdsrecord component.int[]Returns the value of themmTokenTypeIdsrecord component.mrope()Returns the value of themroperecord component.Returns the value of thepixelValuesrecord component.to(Device device, ScalarType dtype) Moves pixel values todevice(no-op when null).final StringtoString()Returns a string representation of this record class.int[][]Returns the value of thevideoGridThwrecord component.
-
Constructor Details
-
ProcessedMultimodal
public ProcessedMultimodal(int[] inputIds, int[] mmTokenTypeIds, Tensor pixelValues, int[][] imageGridThw, int[][] videoGridThw, InterleavedMRope.MropePositions mrope) Creates an instance of aProcessedMultimodalrecord class.- Parameters:
inputIds- the value for theinputIdsrecord componentmmTokenTypeIds- the value for themmTokenTypeIdsrecord componentpixelValues- the value for thepixelValuesrecord componentimageGridThw- the value for theimageGridThwrecord componentvideoGridThw- the value for thevideoGridThwrecord componentmrope- the value for themroperecord component
-
-
Method Details
-
hasVision
public boolean hasVision()Returns whether vision tensors are present.- Returns:
truewhen vision tensors are present.
-
to
Moves pixel values todevice(no-op when null).- Parameters:
device- target device.dtype- compute dtype.- Returns:
- this, with updated pixelValues ownership transferred.
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
inputIds
-
mmTokenTypeIds
public int[] mmTokenTypeIds()Returns the value of themmTokenTypeIdsrecord component.- Returns:
- the value of the
mmTokenTypeIdsrecord component
-
pixelValues
Returns the value of thepixelValuesrecord component.- Returns:
- the value of the
pixelValuesrecord component
-
imageGridThw
public int[][] imageGridThw()Returns the value of theimageGridThwrecord component.- Returns:
- the value of the
imageGridThwrecord component
-
videoGridThw
public int[][] videoGridThw()Returns the value of thevideoGridThwrecord component.- Returns:
- the value of the
videoGridThwrecord component
-
mrope
-