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.Support
Returns what kind ofStreamingTranslator.StreamOutput
thisStreamingTranslator
supports.default StreamingTranslator.StreamOutput<Output>
processStreamOutput
(TranslatorContext ctx, Stream<NDList> list) Processes the output NDList to the corresponding output object.void
setArguments
(Map<String, ?> arguments) Sets the configurations for theTranslator
instance.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
batchProcessInput, batchProcessOutput, getBatchifier, getExpansions, prepare
-
Method Details
-
setArguments
Sets the configurations for theTranslator
instance.- Parameters:
arguments
- the configurations for theTranslator
instance
-
getSupport
Returns what kind ofStreamingTranslator.StreamOutput
thisStreamingTranslator
supports.- Specified by:
getSupport
in interfaceStreamingTranslator<Input,
Output> - Returns:
- what kind of
StreamingTranslator.StreamOutput
thisStreamingTranslator
supports
-
processStreamOutput
default StreamingTranslator.StreamOutput<Output> processStreamOutput(TranslatorContext ctx, Stream<NDList> list) Processes the output NDList to the corresponding output object.- Specified by:
processStreamOutput
in 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
-