Package ai.djl.translate
Interface ServingTranslator
-
- All Superinterfaces:
PostProcessor<Output>,PreProcessor<Input>,StreamingTranslator<Input,Output>,Translator<Input,Output>
public interface ServingTranslator extends StreamingTranslator<Input,Output>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ai.djl.inference.streaming.StreamingTranslator
StreamingTranslator.StreamOutput<O>, StreamingTranslator.Support
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default StreamingTranslator.SupportgetSupport()Returns what kind ofStreamingTranslator.StreamOutputthisStreamingTranslatorsupports.default StreamingTranslator.StreamOutput<Output>processStreamOutput(TranslatorContext ctx, java.util.stream.Stream<NDList> list)Processes the output NDList to the corresponding output object.voidsetArguments(java.util.Map<java.lang.String,?> arguments)Sets the configurations for theTranslatorinstance.-
Methods inherited from interface ai.djl.translate.PostProcessor
processOutput
-
Methods inherited from interface ai.djl.translate.PreProcessor
processInput
-
Methods inherited from interface ai.djl.inference.streaming.StreamingTranslator
supportsAsync, supportsIterative
-
Methods inherited from interface ai.djl.translate.Translator
getBatchifier, getExpansions, prepare, toBatchTranslator, toBatchTranslator
-
-
-
-
Method Detail
-
setArguments
void setArguments(java.util.Map<java.lang.String,?> arguments)
Sets the configurations for theTranslatorinstance.- Parameters:
arguments- the configurations for theTranslatorinstance
-
getSupport
default StreamingTranslator.Support getSupport()
Returns what kind ofStreamingTranslator.StreamOutputthisStreamingTranslatorsupports.- Specified by:
getSupportin interfaceStreamingTranslator<Input,Output>- Returns:
- what kind of
StreamingTranslator.StreamOutputthisStreamingTranslatorsupports
-
processStreamOutput
default StreamingTranslator.StreamOutput<Output> processStreamOutput(TranslatorContext ctx, java.util.stream.Stream<NDList> list)
Processes the output NDList to the corresponding output object.- Specified by:
processStreamOutputin interfaceStreamingTranslator<Input,Output>- Parameters:
ctx- the toolkit used for post-processinglist- the output NDList after inference, usually immutable in engines like PyTorch. @see Issue 1774- Returns:
- the output object of expected type
-
-