Package ai.djl.modality.nlp
Class TextPrompt
java.lang.Object
ai.djl.modality.nlp.TextPrompt
The input container for NLP text prompt.
- 
Method Summary
Modifier and TypeMethodDescriptiongetBatch()Returns the batch prompt.getText()Returns the single prompt.booleanisBatch()Returns if the prompt is a batch.static TextPromptparseInput(Input input) Returns theTextPromptfrom theInput. 
- 
Method Details
- 
isBatch
public boolean isBatch()Returns if the prompt is a batch.- Returns:
 trueif the prompt is a batch
 - 
getText
Returns the single prompt.- Returns:
 - the single prompt
 
 - 
getBatch
Returns the batch prompt.- Returns:
 - the batch prompt
 
 - 
parseInput
Returns theTextPromptfrom theInput.- Parameters:
 input- the input object- Returns:
 - the 
TextPromptfrom theInput - Throws:
 TranslateException- if the input is invalid
 
 -