Package ai.djl.modality.nlp.generate
Class CausalLMOutput
java.lang.Object
ai.djl.modality.nlp.generate.CausalLMOutput
CausalLMOuput is used to contain multiple output of a language model.
-
Constructor Summary
ConstructorsConstructorDescriptionCausalLMOutput(NDArray logits, NDArray hiddenState, NDList pastKeyValueList) Constructs a newCausalLMOutputintance.CausalLMOutput(NDArray logits, NDList pastKeyValues) Constructs a newCausalLMOutputinstance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of the allHiddenStates.Returns the value of the logits.Returns the value of the pastKeyValuesList.voidSets the value of the logits.
-
Constructor Details
-
CausalLMOutput
Constructs a newCausalLMOutputinstance.- Parameters:
logits- the logits NDArraypastKeyValues- the key-value cache
-
CausalLMOutput
Constructs a newCausalLMOutputintance.- Parameters:
logits- the logits NDArrayhiddenState- the first layer hiddenStates used as word embeddingpastKeyValueList- the key-value cache
-
-
Method Details
-
getLogits
Returns the value of the logits.- Returns:
- the value of logits
-
setLogits
Sets the value of the logits.- Parameters:
logits- value of logits NDArray
-
getHiddenState
Returns the value of the allHiddenStates.- Returns:
- the value of allHiddenStates
-
getPastKeyValuesList
Returns the value of the pastKeyValuesList.- Returns:
- the value of pastKeyValuesList
-