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.boolean
isBatch()
Returns if the prompt is a batch.static TextPrompt
parseInput
(Input input) Returns theTextPrompt
from theInput
.
-
Method Details
-
isBatch
public boolean isBatch()Returns if the prompt is a batch.- Returns:
true
if 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 theTextPrompt
from theInput
.- Parameters:
input
- the input object- Returns:
- the
TextPrompt
from theInput
- Throws:
TranslateException
- if the input is invalid
-