Record Class SpeculativeDecoding.AcceptResult
java.lang.Object
java.lang.Record
smile.llm.engine.SpeculativeDecoding.AcceptResult
- Record Components:
numDraftAccepted- number of draft tokens accepted (0..N).acceptedTokens- accepted drafts plus the bonus token (lengthr+1).
- Enclosing class:
SpeculativeDecoding
public static record SpeculativeDecoding.AcceptResult(int numDraftAccepted, int[] acceptedTokens)
extends Record
Result of one speculative verify round.
-
Constructor Summary
ConstructorsConstructorDescriptionAcceptResult(int numDraftAccepted, int[] acceptedTokens) Creates an instance of aAcceptResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionint[]Returns the value of theacceptedTokensrecord component.intReturns the bonus (target) token always kept at the end.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thenumDraftAcceptedrecord component.intReturns total tokens to emit this round.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AcceptResult
public AcceptResult(int numDraftAccepted, int[] acceptedTokens) Creates an instance of aAcceptResultrecord class.- Parameters:
numDraftAccepted- the value for thenumDraftAcceptedrecord componentacceptedTokens- the value for theacceptedTokensrecord component
-
-
Method Details
-
numTokens
public int numTokens()Returns total tokens to emit this round.- Returns:
- total tokens to emit this round (
numDraftAccepted + 1).
-
bonusToken
public int bonusToken()Returns the bonus (target) token always kept at the end.- Returns:
- the bonus (target) token always kept at the end.
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
numDraftAccepted
public int numDraftAccepted()Returns the value of thenumDraftAcceptedrecord component.- Returns:
- the value of the
numDraftAcceptedrecord component
-
acceptedTokens
public int[] acceptedTokens()Returns the value of theacceptedTokensrecord component.- Returns:
- the value of the
acceptedTokensrecord component
-