Package ai.djl.translate
Interface ServingTranslator
- All Superinterfaces:
PostProcessor<Output>,PreProcessor<Input>,StreamingTranslator<Input,,Output> Translator<Input,Output>
-
Nested Class Summary
Nested classes/interfaces inherited from interface ai.djl.inference.streaming.StreamingTranslator
StreamingTranslator.StreamOutput<O>, StreamingTranslator.Support -
Method Summary
Modifier and TypeMethodDescriptiondefault StreamingTranslator.SupportReturns what kind ofStreamingTranslator.StreamOutputthisStreamingTranslatorsupports.default StreamingTranslator.StreamOutput<Output>processStreamOutput(TranslatorContext ctx, Stream<NDList> list) Processes the output NDList to the corresponding output object.voidsetArguments(Map<String, ?> arguments) Sets the configurations for theTranslatorinstance.Methods inherited from interface ai.djl.translate.PostProcessor
processOutputMethods inherited from interface ai.djl.translate.PreProcessor
processInputMethods inherited from interface ai.djl.inference.streaming.StreamingTranslator
supportsAsync, supportsIterativeMethods inherited from interface ai.djl.translate.Translator
batchProcessInput, batchProcessOutput, getBatchifier, getExpansions, prepare
-
Method Details
-
setArguments
Sets the configurations for theTranslatorinstance.- Parameters:
arguments- the configurations for theTranslatorinstance
-
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, 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
-