Record Class MiniMaxMultimodal
java.lang.Object
java.lang.Record
smile.llm.model.minimax.MiniMaxMultimodal
- Record Components:
inputIds- expanded prompt token ids.imagePixels- patches of all images back to back,[N, patchDim]float32 on the CPU, ornull.imageGrids- one(t, h, w)patch grid per image, in prompt order.videoPixels- patches of all videos back to back, ornull.videoGrids- one(t, h, w)patch grid per video, in prompt order.
- All Implemented Interfaces:
MultimodalPrompt
public record MiniMaxMultimodal(int[] inputIds, Tensor imagePixels, int[][] imageGrids, Tensor videoPixels, int[][] videoGrids)
extends Record
implements MultimodalPrompt
A MiniMax-M3 prompt with its images and videos preprocessed: the token ids (every media placeholder expanded to
one id per vision token) plus the patch matrices and grids the vision tower encodes during prefill.
-
Constructor Summary
ConstructorsConstructorDescriptionMiniMaxMultimodal(int[] inputIds, Tensor imagePixels, int[][] imageGrids, Tensor videoPixels, int[][] videoGrids) Creates an instance of aMiniMaxMultimodalrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases the CPU patch matrices.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns whether the prompt carries vision tensors.int[][]Returns the value of theimageGridsrecord component.Returns the value of theimagePixelsrecord component.int[]inputIds()Returns the value of theinputIdsrecord component.final StringtoString()Returns a string representation of this record class.int[][]Returns the value of thevideoGridsrecord component.Returns the value of thevideoPixelsrecord component.
-
Constructor Details
-
MiniMaxMultimodal
public MiniMaxMultimodal(int[] inputIds, Tensor imagePixels, int[][] imageGrids, Tensor videoPixels, int[][] videoGrids) Creates an instance of aMiniMaxMultimodalrecord class.- Parameters:
inputIds- the value for theinputIdsrecord componentimagePixels- the value for theimagePixelsrecord componentimageGrids- the value for theimageGridsrecord componentvideoPixels- the value for thevideoPixelsrecord componentvideoGrids- the value for thevideoGridsrecord component
-
-
Method Details
-
hasVision
public boolean hasVision()Description copied from interface:MultimodalPromptReturns whether the prompt carries vision tensors.- Specified by:
hasVisionin interfaceMultimodalPrompt- Returns:
truewhen media must be encoded during prefill.
-
close
public void close()Releases the CPU patch matrices. -
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
public int[] inputIds()Returns the value of theinputIdsrecord component.- Specified by:
inputIdsin interfaceMultimodalPrompt- Returns:
- the value of the
inputIdsrecord component
-
imagePixels
Returns the value of theimagePixelsrecord component.- Returns:
- the value of the
imagePixelsrecord component
-
imageGrids
public int[][] imageGrids()Returns the value of theimageGridsrecord component.- Returns:
- the value of the
imageGridsrecord component
-
videoPixels
Returns the value of thevideoPixelsrecord component.- Returns:
- the value of the
videoPixelsrecord component
-
videoGrids
public int[][] videoGrids()Returns the value of thevideoGridsrecord component.- Returns:
- the value of the
videoGridsrecord component
-