Documentation
¶
Index ¶
- func RenderDecisionState(v any) (string, error)
- func WithASRBlankID(id int) backends.PipelineOption[*AutomaticSpeechRecognitionPipeline]
- func WithASRPrompt(prompt string) backends.PipelineOption[*AutomaticSpeechRecognitionPipeline]
- func WithASRSampleRate(sampleRate int) backends.PipelineOption[*AutomaticSpeechRecognitionPipeline]
- func WithASRStreamingOptions(opts StreamingASROptions) backends.PipelineOption[*AutomaticSpeechRecognitionPipeline]
- func WithAudioClassificationSampleRate(sampleRate int) backends.PipelineOption[*AudioClassificationPipeline]
- func WithAudioTopK(topK int) backends.PipelineOption[*AudioClassificationPipeline]
- func WithAverageAggregation() backends.PipelineOption[*TokenClassificationPipeline]
- func WithBackgroundRemovalOutput(name string) backends.PipelineOption[*BackgroundRemovalPipeline]
- func WithBatchSize(size int) backends.PipelineOption[*CrossEncoderPipeline]
- func WithBoxesOutput(name string) backends.PipelineOption[*ObjectDetectionPipeline]
- func WithClassification() backends.PipelineOption[*TabularPipeline]
- func WithDecisionMaxBatchRows(n int) backends.PipelineOption[*DecisionPipeline]
- func WithDecisionMaxBatchTokens(n int) backends.PipelineOption[*DecisionPipeline]
- func WithDecisionQuestions(questions map[string]DecisionQuestion) backends.PipelineOption[*DecisionPipeline]
- func WithDetectionIouThreshold(th float32) backends.PipelineOption[*ObjectDetectionPipeline]
- func WithDetectionScoreThreshold(th float32) backends.PipelineOption[*ObjectDetectionPipeline]
- func WithDetectionTopK(k int) backends.PipelineOption[*ObjectDetectionPipeline]
- func WithEnableThinking(enabled bool) backends.PipelineOption[*TextGenerationPipeline]
- func WithFillMaskTopK(topK int) backends.PipelineOption[*FillMaskPipeline]
- func WithFirstAggregation() backends.PipelineOption[*TokenClassificationPipeline]
- func WithFixedPadding(fixedPaddingLength int) backends.PipelineOption[*TextClassificationPipeline]
- func WithGroundedThresholds(box, text float32) backends.PipelineOption[*GroundedObjectDetectionPipeline]
- func WithGuidance(guidance *backends.Guidance) backends.PipelineOption[*TextGenerationPipeline]
- func WithHypothesisTemplate(hypothesisTemplate string) backends.PipelineOption[*ZeroShotClassificationPipeline]
- func WithIDLabelMap(labels map[int]string) backends.PipelineOption[*TabularPipeline]
- func WithIgnoreLabels(ignoreLabels []string) backends.PipelineOption[*TokenClassificationPipeline]
- func WithImageCLSToken() backends.PipelineOption[*ImageFeatureExtractionPipeline]
- func WithImageEmbeddingNormalization() backends.PipelineOption[*ImageFeatureExtractionPipeline]
- func WithImageLabels(labels []string) backends.PipelineOption[*ZeroShotImageClassificationPipeline]
- func WithImageMode() backends.PipelineOption[*FeatureExtractionPipeline]
- func WithImageModelPooler() backends.PipelineOption[*ImageFeatureExtractionPipeline]
- func WithImageTopK(k int) backends.PipelineOption[*ZeroShotImageClassificationPipeline]
- func WithLabels(labels []string) backends.PipelineOption[*ZeroShotClassificationPipeline]
- func WithMaskToken(token string) backends.PipelineOption[*FillMaskPipeline]
- func WithMaxAggregation() backends.PipelineOption[*TokenClassificationPipeline]
- func WithMaxLength(maxLength int) backends.PipelineOption[*TextGenerationPipeline]
- func WithModelPooler() backends.PipelineOption[*FeatureExtractionPipeline]
- func WithMultiLabel() backends.PipelineOption[*TextClassificationPipeline]
- func WithMultilabel(multilabel bool) backends.PipelineOption[*ZeroShotClassificationPipeline]
- func WithNCHWFormat[T imagePipeline]() backends.PipelineOption[T]
- func WithNHWCFormat[T imagePipeline]() backends.PipelineOption[T]
- func WithNormalization() backends.PipelineOption[*FeatureExtractionPipeline]
- func WithNormalizationSteps[T imagePipeline](steps ...imageutil.NormalizationStep) backends.PipelineOption[T]
- func WithOutputName(outputName string) backends.PipelineOption[*FeatureExtractionPipeline]
- func WithPreprocessSteps[T imagePipeline](steps ...imageutil.PreprocessStep) backends.PipelineOption[T]
- func WithRegression() backends.PipelineOption[*TabularPipeline]
- func WithScoreThreshold(threshold float32) backends.PipelineOption[*CrossEncoderPipeline]
- func WithScoresOutput(name string) backends.PipelineOption[*ObjectDetectionPipeline]
- func WithSeed(seed int) backends.PipelineOption[*TextGenerationPipeline]
- func WithSegmentationLogitsOutput(name string) backends.PipelineOption[*ImageSegmentationPipeline]
- func WithSegmentationScoreThreshold(threshold float32) backends.PipelineOption[*ImageSegmentationPipeline]
- func WithSigmoid() backends.PipelineOption[*TextClassificationPipeline]
- func WithSimpleAggregation() backends.PipelineOption[*TokenClassificationPipeline]
- func WithSingleLabel() backends.PipelineOption[*TextClassificationPipeline]
- func WithSoftmax() backends.PipelineOption[*TextClassificationPipeline]
- func WithSortResults() backends.PipelineOption[*CrossEncoderPipeline]
- func WithSplitWords() backends.PipelineOption[*TokenClassificationPipeline]
- func WithStopSequences(stopSequences []string) backends.PipelineOption[*TextGenerationPipeline]
- func WithStreaming() backends.PipelineOption[*TextGenerationPipeline]
- func WithSystemPrompt(systemPrompt string) backends.PipelineOption[*TextGenerationPipeline]
- func WithTabularSigmoid() backends.PipelineOption[*TabularPipeline]
- func WithTabularSoftmax() backends.PipelineOption[*TabularPipeline]
- func WithTemperature(temperature float64) backends.PipelineOption[*TextGenerationPipeline]
- func WithTools(tools []string) backends.PipelineOption[*TextGenerationPipeline]
- func WithTopK(topK int) backends.PipelineOption[*ImageClassificationPipeline]
- func WithTopP(topP float64) backends.PipelineOption[*TextGenerationPipeline]
- func WithWordSplitter(splitter WordSplitter) backends.PipelineOption[*TokenClassificationPipeline]
- func WithZeroShotObjectLabels(labels []string) backends.PipelineOption[*ZeroShotObjectDetectionPipeline]
- func WithoutAggregation() backends.PipelineOption[*TokenClassificationPipeline]
- type ASRTimestamp
- type AddressParseAddress
- type AddressParseComponent
- type AddressParseConfig
- type AddressParseOption
- func WithAddressParseBatchSize(size int) AddressParseOption
- func WithAddressParseHyphenSplit() AddressParseOption
- func WithAddressParseManifestFilename(filename string) AddressParseOption
- func WithAddressParsePreprocessors(processors ...AddressParsePreprocessor) AddressParseOption
- func WithAddressParseProbabilities(enabled bool) AddressParseOption
- func WithAddressParseProbabilityRounding(digits int) AddressParseOption
- type AddressParseOutput
- type AddressParsePipeline
- func (p *AddressParsePipeline) GetMetadata() backends.PipelineMetadata
- func (p *AddressParsePipeline) GetModel() *backends.Model
- func (p *AddressParsePipeline) GetStatistics() backends.PipelineStatistics
- func (*AddressParsePipeline) IsGenerative() bool
- func (p *AddressParsePipeline) Run(ctx context.Context, addresses []string) (backends.PipelineBatchOutput, error)
- func (p *AddressParsePipeline) RunAddresses(ctx context.Context, addresses []string) (*AddressParseOutput, error)
- func (p *AddressParsePipeline) Validate() error
- type AddressParsePreprocessor
- type AddressParseWord
- type AnyToAnyConfig
- type AnyToAnyEvent
- type AnyToAnyOption
- func WithAnyToAnyGenerationMode(mode string) AnyToAnyOption
- func WithAnyToAnyGuidance(guidance *backends.Guidance) AnyToAnyOption
- func WithAnyToAnyMaxLength(n int) AnyToAnyOption
- func WithAnyToAnyMaxNewTokens(n int) AnyToAnyOption
- func WithAnyToAnyStreaming() AnyToAnyOption
- func WithAnyToAnySystemPrompt(prompt string) AnyToAnyOption
- func WithAnyToAnyTools(tools []string) AnyToAnyOption
- func WithAnyToAnyVideoDecoder(decoder VideoDecoder, maxFrames int) AnyToAnyOption
- type AnyToAnyOutput
- type AnyToAnyPipeline
- func (p AnyToAnyPipeline) GetMetadata() backends.PipelineMetadata
- func (p AnyToAnyPipeline) GetModel() *backends.Model
- func (p *AnyToAnyPipeline) GetStatistics() backends.PipelineStatistics
- func (*AnyToAnyPipeline) IsGenerative() bool
- func (p *AnyToAnyPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *AnyToAnyPipeline) RunConversations(ctx context.Context, inputs [][]MultimodalMessage) (*AnyToAnyOutput, error)
- func (p *AnyToAnyPipeline) RunMessages(ctx context.Context, inputs [][]backends.Message) (*AnyToAnyOutput, error)
- func (p *AnyToAnyPipeline) Validate() error
- type AnyToAnyResult
- type AudioClassificationOutput
- type AudioClassificationPipeline
- func (p *AudioClassificationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *AudioClassificationPipeline) GetModel() *backends.Model
- func (p *AudioClassificationPipeline) GetStatistics() backends.PipelineStatistics
- func (p *AudioClassificationPipeline) IsGenerative() bool
- func (p *AudioClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *AudioClassificationPipeline) RunFiles(ctx context.Context, paths []string) (*AudioClassificationOutput, error)
- func (p *AudioClassificationPipeline) RunWaveforms(ctx context.Context, inputs []AudioWaveform) (*AudioClassificationOutput, error)
- func (p *AudioClassificationPipeline) RunWithAudio(ctx context.Context, inputs [][]float32) (*AudioClassificationOutput, error)
- func (p *AudioClassificationPipeline) Validate() error
- type AudioClassificationResult
- type AudioWaveform
- type AutomaticSpeechRecognitionOutput
- type AutomaticSpeechRecognitionPipeline
- func (p *AutomaticSpeechRecognitionPipeline) GetMetadata() backends.PipelineMetadata
- func (p *AutomaticSpeechRecognitionPipeline) GetModel() *backends.Model
- func (p *AutomaticSpeechRecognitionPipeline) GetStatistics() backends.PipelineStatistics
- func (p *AutomaticSpeechRecognitionPipeline) IsGenerative() bool
- func (p *AutomaticSpeechRecognitionPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *AutomaticSpeechRecognitionPipeline) RunAudioStream(ctx context.Context, chunks <-chan []float32) (<-chan backends.ASRResult, <-chan error, error)
- func (p *AutomaticSpeechRecognitionPipeline) RunFiles(ctx context.Context, paths []string) (*AutomaticSpeechRecognitionOutput, error)
- func (p *AutomaticSpeechRecognitionPipeline) RunWaveforms(ctx context.Context, inputs []AudioWaveform) (*AutomaticSpeechRecognitionOutput, error)
- func (p *AutomaticSpeechRecognitionPipeline) RunWithAudio(ctx context.Context, inputs [][]float32) (*AutomaticSpeechRecognitionOutput, error)
- func (*AutomaticSpeechRecognitionPipeline) SupportsGenerativeModelLoading() bool
- func (p *AutomaticSpeechRecognitionPipeline) Validate() error
- type BackgroundRemovalOutput
- type BackgroundRemovalPipeline
- func (p *BackgroundRemovalPipeline) GetMetadata() backends.PipelineMetadata
- func (p *BackgroundRemovalPipeline) GetModel() *backends.Model
- func (p *BackgroundRemovalPipeline) GetStatistics() backends.PipelineStatistics
- func (p *BackgroundRemovalPipeline) IsGenerative() bool
- func (p *BackgroundRemovalPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *BackgroundRemovalPipeline) RunPipeline(ctx context.Context, inputs []string) (*BackgroundRemovalOutput, error)
- func (p *BackgroundRemovalPipeline) RunWithImages(ctx context.Context, inputs []image.Image) (*BackgroundRemovalOutput, error)
- func (p *BackgroundRemovalPipeline) Validate() error
- type BackgroundRemovalResult
- type ClassificationOutput
- type CrossEncoderOutput
- type CrossEncoderPipeline
- func (p *CrossEncoderPipeline) GetMetadata() backends.PipelineMetadata
- func (p *CrossEncoderPipeline) GetModel() *backends.Model
- func (p *CrossEncoderPipeline) GetStatistics() backends.PipelineStatistics
- func (p *CrossEncoderPipeline) IsGenerative() bool
- func (p *CrossEncoderPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *CrossEncoderPipeline) RunPipeline(ctx context.Context, query string, documents []string) (*CrossEncoderOutput, error)
- func (p *CrossEncoderPipeline) Validate() error
- type CrossEncoderResult
- type CrossEncoderStatistics
- type DecisionAnswer
- type DecisionCriterion
- type DecisionInput
- type DecisionOutput
- type DecisionPipeline
- func (p *DecisionPipeline) GetMetadata() backends.PipelineMetadata
- func (p *DecisionPipeline) GetModel() *backends.Model
- func (p *DecisionPipeline) GetStatistics() backends.PipelineStatistics
- func (*DecisionPipeline) IsGenerative() bool
- func (p *DecisionPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *DecisionPipeline) RunPipeline(ctx context.Context, inputs []DecisionInput) (*DecisionOutput, error)
- func (p *DecisionPipeline) Validate() error
- type DecisionQuestion
- type DecisionQuestionType
- type DecisionReadoutConfig
- type DecisionResult
- type DepthEstimationConfig
- type DepthEstimationOption
- type DepthEstimationOutput
- type DepthEstimationPipeline
- func (p *DepthEstimationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *DepthEstimationPipeline) GetModel() *backends.Model
- func (p *DepthEstimationPipeline) GetStatistics() backends.PipelineStatistics
- func (p *DepthEstimationPipeline) IsGenerative() bool
- func (p *DepthEstimationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *DepthEstimationPipeline) RunPipeline(ctx context.Context, inputs []string) (*DepthEstimationOutput, error)
- func (p *DepthEstimationPipeline) RunWithImagePaths(ctx context.Context, paths []string) (*DepthEstimationOutput, error)
- func (p *DepthEstimationPipeline) RunWithImages(ctx context.Context, images []image.Image) (*DepthEstimationOutput, error)
- func (p *DepthEstimationPipeline) Validate() error
- type DepthEstimationResult
- type Detection
- type DocumentQuestionAnsweringConfig
- type DocumentQuestionAnsweringInput
- type DocumentQuestionAnsweringOption
- type DocumentQuestionAnsweringOutput
- type DocumentQuestionAnsweringPipeline
- func (p *DocumentQuestionAnsweringPipeline) GetMetadata() backends.PipelineMetadata
- func (p *DocumentQuestionAnsweringPipeline) GetModel() *backends.Model
- func (p *DocumentQuestionAnsweringPipeline) GetStatistics() backends.PipelineStatistics
- func (*DocumentQuestionAnsweringPipeline) IsGenerative() bool
- func (p *DocumentQuestionAnsweringPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *DocumentQuestionAnsweringPipeline) RunPipeline(ctx context.Context, inputs []DocumentQuestionAnsweringInput) (*DocumentQuestionAnsweringOutput, error)
- func (p *DocumentQuestionAnsweringPipeline) RunWithImages(ctx context.Context, inputs []backends.ImageTextInput) (*DocumentQuestionAnsweringOutput, error)
- func (p *DocumentQuestionAnsweringPipeline) Validate() error
- type DocumentQuestionAnsweringResult
- type Entity
- type FFmpegVideoDecoder
- type FeatureExtractionOutput
- type FeatureExtractionPipeline
- func (p *FeatureExtractionPipeline) GetMetadata() backends.PipelineMetadata
- func (p *FeatureExtractionPipeline) GetModel() *backends.Model
- func (p *FeatureExtractionPipeline) GetStatistics() backends.PipelineStatistics
- func (p *FeatureExtractionPipeline) IsGenerative() bool
- func (p *FeatureExtractionPipeline) PreprocessImages(batch *backends.PipelineBatch, inputs []image.Image) error
- func (p *FeatureExtractionPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *FeatureExtractionPipeline) RunPipeline(ctx context.Context, inputs []string) (*FeatureExtractionOutput, error)
- func (p *FeatureExtractionPipeline) RunRaw(ctx context.Context, inputs []string) (*RawFeatureOutput, error)
- func (p *FeatureExtractionPipeline) RunRawWithImagePaths(ctx context.Context, paths []string) (*RawFeatureOutput, error)
- func (p *FeatureExtractionPipeline) RunRawWithImages(ctx context.Context, images []image.Image) (*RawFeatureOutput, error)
- func (p *FeatureExtractionPipeline) RunWithImagePaths(ctx context.Context, paths []string) (*FeatureExtractionOutput, error)
- func (p *FeatureExtractionPipeline) RunWithImages(ctx context.Context, images []image.Image) (*FeatureExtractionOutput, error)
- func (p *FeatureExtractionPipeline) Validate() error
- type FillMaskOutput
- type FillMaskPipeline
- func (p *FillMaskPipeline) GetMetadata() backends.PipelineMetadata
- func (p *FillMaskPipeline) GetModel() *backends.Model
- func (p *FillMaskPipeline) GetStatistics() backends.PipelineStatistics
- func (p *FillMaskPipeline) IsGenerative() bool
- func (p *FillMaskPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *FillMaskPipeline) RunPipeline(ctx context.Context, inputs []string) (*FillMaskOutput, error)
- func (p *FillMaskPipeline) Validate() error
- type FillMaskResult
- type GroundedObjectDetectionPipeline
- func (p *GroundedObjectDetectionPipeline) GetMetadata() backends.PipelineMetadata
- func (p *GroundedObjectDetectionPipeline) GetModel() *backends.Model
- func (p *GroundedObjectDetectionPipeline) GetStatistics() backends.PipelineStatistics
- func (*GroundedObjectDetectionPipeline) IsGenerative() bool
- func (p *GroundedObjectDetectionPipeline) Run(context.Context, []string) (backends.PipelineBatchOutput, error)
- func (p *GroundedObjectDetectionPipeline) RunWithCaption(ctx context.Context, inputs []string, caption string) (*ObjectDetectionOutput, error)
- func (p *GroundedObjectDetectionPipeline) RunWithImagesAndCaption(ctx context.Context, images []image.Image, caption string) (*ObjectDetectionOutput, error)
- func (p *GroundedObjectDetectionPipeline) Validate() error
- type ImageClassificationOutput
- type ImageClassificationPipeline
- func (p *ImageClassificationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *ImageClassificationPipeline) GetModel() *backends.Model
- func (p *ImageClassificationPipeline) GetStatistics() backends.PipelineStatistics
- func (p *ImageClassificationPipeline) IsGenerative() bool
- func (p *ImageClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *ImageClassificationPipeline) RunPipeline(ctx context.Context, inputs []string) (*ImageClassificationOutput, error)
- func (p *ImageClassificationPipeline) RunWithImages(ctx context.Context, inputs []image.Image) (*ImageClassificationOutput, error)
- func (p *ImageClassificationPipeline) Validate() error
- type ImageClassificationResult
- type ImageFeatureExtractionOutput
- type ImageFeatureExtractionPipeline
- func (p *ImageFeatureExtractionPipeline) GetMetadata() backends.PipelineMetadata
- func (p *ImageFeatureExtractionPipeline) GetModel() *backends.Model
- func (p *ImageFeatureExtractionPipeline) GetStatistics() backends.PipelineStatistics
- func (p *ImageFeatureExtractionPipeline) IsGenerative() bool
- func (p *ImageFeatureExtractionPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *ImageFeatureExtractionPipeline) RunPipeline(ctx context.Context, inputs []string) (*ImageFeatureExtractionOutput, error)
- func (p *ImageFeatureExtractionPipeline) RunRaw(ctx context.Context, inputs []string) (*RawFeatureOutput, error)
- func (p *ImageFeatureExtractionPipeline) RunRawWithImages(ctx context.Context, images []image.Image) (*RawFeatureOutput, error)
- func (p *ImageFeatureExtractionPipeline) RunWithImages(ctx context.Context, images []image.Image) (*ImageFeatureExtractionOutput, error)
- func (p *ImageFeatureExtractionPipeline) Validate() error
- type ImagePair
- type ImageSegmentationOutput
- type ImageSegmentationPipeline
- func (p *ImageSegmentationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *ImageSegmentationPipeline) GetModel() *backends.Model
- func (p *ImageSegmentationPipeline) GetStatistics() backends.PipelineStatistics
- func (p *ImageSegmentationPipeline) IsGenerative() bool
- func (p *ImageSegmentationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *ImageSegmentationPipeline) RunPipeline(ctx context.Context, inputs []string) (*ImageSegmentationOutput, error)
- func (p *ImageSegmentationPipeline) RunWithImages(ctx context.Context, images []image.Image) (*ImageSegmentationOutput, error)
- func (p *ImageSegmentationPipeline) Validate() error
- type ImageSegmentationResult
- type ImageSegmentationSegment
- type ImageTextPrompt
- type ImageTextToTextConfig
- type ImageTextToTextOption
- type ImageTextToTextPipeline
- func (p ImageTextToTextPipeline) GetMetadata() backends.PipelineMetadata
- func (p ImageTextToTextPipeline) GetModel() *backends.Model
- func (p ImageTextToTextPipeline) GetStatistics() backends.PipelineStatistics
- func (*ImageTextToTextPipeline) IsGenerative() bool
- func (p *ImageTextToTextPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *ImageTextToTextPipeline) RunWithImages(ctx context.Context, inputs []ImageTextPrompt) (*MultimodalTextOutput, error)
- func (p ImageTextToTextPipeline) Validate() error
- type Keypoint
- type KeypointMatch
- type KeypointMatchingConfig
- type KeypointMatchingOption
- type KeypointMatchingOutput
- type KeypointMatchingPipeline
- func (p *KeypointMatchingPipeline) GetMetadata() backends.PipelineMetadata
- func (p *KeypointMatchingPipeline) GetModel() *backends.Model
- func (p *KeypointMatchingPipeline) GetStatistics() backends.PipelineStatistics
- func (*KeypointMatchingPipeline) IsGenerative() bool
- func (p *KeypointMatchingPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *KeypointMatchingPipeline) RunPairs(ctx context.Context, pairs []ImagePair) (*KeypointMatchingOutput, error)
- func (p *KeypointMatchingPipeline) Validate() error
- type MaskGenerationMask
- type MaskGenerationOutput
- type MaskGenerationPipeline
- func (p *MaskGenerationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *MaskGenerationPipeline) GetModel() *backends.Model
- func (p *MaskGenerationPipeline) GetStatistics() backends.PipelineStatistics
- func (*MaskGenerationPipeline) IsGenerative() bool
- func (p *MaskGenerationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *MaskGenerationPipeline) RunPipeline(ctx context.Context, inputs []string) (*MaskGenerationOutput, error)
- func (p *MaskGenerationPipeline) RunWithBoxes(ctx context.Context, img image.Image, boxes [][4]float32) (*MaskGenerationOutput, error)
- func (p *MaskGenerationPipeline) RunWithImages(ctx context.Context, images []image.Image) (*MaskGenerationOutput, error)
- func (p *MaskGenerationPipeline) RunWithPoints(ctx context.Context, img image.Image, points [][2]float32, labels []int64) (*MaskGenerationOutput, error)
- func (p *MaskGenerationPipeline) Validate() error
- type MaskGenerationResult
- type MultimodalContent
- type MultimodalMessage
- type MultimodalTextOutput
- type ObjectDetectionOutput
- type ObjectDetectionPipeline
- func (p *ObjectDetectionPipeline) GetMetadata() backends.PipelineMetadata
- func (p *ObjectDetectionPipeline) GetModel() *backends.Model
- func (p *ObjectDetectionPipeline) GetStatistics() backends.PipelineStatistics
- func (p *ObjectDetectionPipeline) GetStats() []string
- func (p *ObjectDetectionPipeline) IsGenerative() bool
- func (p *ObjectDetectionPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *ObjectDetectionPipeline) RunPipeline(ctx context.Context, inputs []string) (*ObjectDetectionOutput, error)
- func (p *ObjectDetectionPipeline) RunWithImages(ctx context.Context, inputs []image.Image) (*ObjectDetectionOutput, error)
- func (p *ObjectDetectionPipeline) Validate() error
- type RawFeatureOutput
- type StreamingASROptions
- type TableQuestionAnsweringConfig
- type TableQuestionAnsweringInput
- type TableQuestionAnsweringOption
- type TableQuestionAnsweringOutput
- type TableQuestionAnsweringPipeline
- func (p *TableQuestionAnsweringPipeline) GetMetadata() backends.PipelineMetadata
- func (p *TableQuestionAnsweringPipeline) GetModel() *backends.Model
- func (p *TableQuestionAnsweringPipeline) GetStatistics() backends.PipelineStatistics
- func (*TableQuestionAnsweringPipeline) IsGenerative() bool
- func (p *TableQuestionAnsweringPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *TableQuestionAnsweringPipeline) RunPipeline(ctx context.Context, inputs []TableQuestionAnsweringInput) (*TableQuestionAnsweringOutput, error)
- func (p *TableQuestionAnsweringPipeline) RunSequential(ctx context.Context, table [][]string, questions []string) (*TableQuestionAnsweringOutput, error)
- func (p *TableQuestionAnsweringPipeline) Validate() error
- type TableQuestionAnsweringResult
- type TabularClassificationOutput
- type TabularOutput
- type TabularPipeline
- func (p *TabularPipeline) GetMetadata() backends.PipelineMetadata
- func (p *TabularPipeline) GetModel() *backends.Model
- func (p *TabularPipeline) GetStatistics() backends.PipelineStatistics
- func (p *TabularPipeline) IsGenerative() bool
- func (p *TabularPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *TabularPipeline) RunPipeline(ctx context.Context, inputs [][]float32) (*TabularOutput, error)
- func (p *TabularPipeline) Validate() error
- type TextClassificationOutput
- type TextClassificationPipeline
- func (p *TextClassificationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *TextClassificationPipeline) GetModel() *backends.Model
- func (p *TextClassificationPipeline) GetStatistics() backends.PipelineStatistics
- func (p *TextClassificationPipeline) IsGenerative() bool
- func (p *TextClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *TextClassificationPipeline) RunPipeline(ctx context.Context, inputs []string) (*TextClassificationOutput, error)
- func (p *TextClassificationPipeline) Validate() error
- type TextGenerationCallOptions
- type TextGenerationOutput
- type TextGenerationPipeline
- func (p *TextGenerationPipeline) GetContextLength() int
- func (p *TextGenerationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *TextGenerationPipeline) GetModel() *backends.Model
- func (p *TextGenerationPipeline) GetStatistics() backends.PipelineStatistics
- func (p *TextGenerationPipeline) IsGenerative() bool
- func (p *TextGenerationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *TextGenerationPipeline) RunMessages(ctx context.Context, inputs [][]backends.Message) (*TextGenerationOutput, error)
- func (p *TextGenerationPipeline) RunMessagesWithOptions(ctx context.Context, inputs [][]backends.Message, ...) (*TextGenerationOutput, error)
- func (p *TextGenerationPipeline) RunMessagesWithOverrides(ctx context.Context, inputs [][]backends.Message, tools []string, ...) (*TextGenerationOutput, error)
- func (p *TextGenerationPipeline) RunPipeline(ctx context.Context, inputs []string) (*TextGenerationOutput, error)
- func (p *TextGenerationPipeline) RunPipelineWithOptions(ctx context.Context, inputs []string, options *TextGenerationCallOptions) (*TextGenerationOutput, error)
- func (p *TextGenerationPipeline) RunWithOptions(ctx context.Context, inputs []string, options *TextGenerationCallOptions) (backends.PipelineBatchOutput, error)
- func (p *TextGenerationPipeline) Validate() error
- type TextToAudioConfig
- type TextToAudioOption
- type TextToAudioOutput
- type TextToAudioPipeline
- func (p *TextToAudioPipeline) GetMetadata() backends.PipelineMetadata
- func (p *TextToAudioPipeline) GetModel() *backends.Model
- func (p *TextToAudioPipeline) GetStatistics() backends.PipelineStatistics
- func (p *TextToAudioPipeline) IsGenerative() bool
- func (p *TextToAudioPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *TextToAudioPipeline) RunText(ctx context.Context, inputs []string) (*TextToAudioOutput, error)
- func (p *TextToAudioPipeline) Validate() error
- type TextToSpeechConfig
- type TextToSpeechOption
- type TextToSpeechOutput
- type TextToSpeechPipeline
- type TokenClassificationOutput
- type TokenClassificationPipeline
- func (p *TokenClassificationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *TokenClassificationPipeline) GetModel() *backends.Model
- func (p *TokenClassificationPipeline) GetStatistics() backends.PipelineStatistics
- func (p *TokenClassificationPipeline) IsGenerative() bool
- func (p *TokenClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *TokenClassificationPipeline) RunPipeline(ctx context.Context, inputs []string) (*TokenClassificationOutput, error)
- func (p *TokenClassificationPipeline) RunWords(ctx context.Context, inputs [][]string) (*TokenClassificationOutput, error)
- func (p *TokenClassificationPipeline) SplitText(text string) ([]string, error)
- func (p *TokenClassificationPipeline) Validate() error
- type VideoClassificationConfig
- type VideoClassificationOption
- func WithVideoClassificationFunction(function string) VideoClassificationOption
- func WithVideoClassificationTopK(k int) VideoClassificationOption
- func WithVideoDecoder(decoder VideoDecoder) VideoClassificationOption
- func WithVideoSampling(numFrames, rate int) VideoClassificationOption
- func WithVideoTensorLayout(layout string) VideoClassificationOption
- type VideoClassificationOutput
- type VideoClassificationPipeline
- func (p *VideoClassificationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *VideoClassificationPipeline) GetModel() *backends.Model
- func (p *VideoClassificationPipeline) GetStatistics() backends.PipelineStatistics
- func (*VideoClassificationPipeline) IsGenerative() bool
- func (p *VideoClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *VideoClassificationPipeline) RunFiles(ctx context.Context, paths []string) (*VideoClassificationOutput, error)
- func (p *VideoClassificationPipeline) RunFrames(ctx context.Context, inputs []VideoInput) (*VideoClassificationOutput, error)
- func (p *VideoClassificationPipeline) Validate() error
- type VideoDecoder
- type VideoInput
- type WordSplitter
- type ZeroShotAudioClassificationConfig
- type ZeroShotAudioClassificationOption
- func WithAudioLabels(labels []string) ZeroShotAudioClassificationOption
- func WithZeroShotAudioHypothesisTemplate(template string) ZeroShotAudioClassificationOption
- func WithZeroShotAudioLabels(labels []string) ZeroShotAudioClassificationOption
- func WithZeroShotAudioSampleRate(sampleRate int) ZeroShotAudioClassificationOption
- func WithZeroShotAudioTopK(k int) ZeroShotAudioClassificationOption
- type ZeroShotAudioClassificationOutput
- type ZeroShotAudioClassificationPipeline
- func (p *ZeroShotAudioClassificationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *ZeroShotAudioClassificationPipeline) GetModel() *backends.Model
- func (p *ZeroShotAudioClassificationPipeline) GetStatistics() backends.PipelineStatistics
- func (p *ZeroShotAudioClassificationPipeline) IsGenerative() bool
- func (p *ZeroShotAudioClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *ZeroShotAudioClassificationPipeline) RunFiles(ctx context.Context, paths []string) (*ZeroShotAudioClassificationOutput, error)
- func (p *ZeroShotAudioClassificationPipeline) RunWaveforms(ctx context.Context, inputs []AudioWaveform) (*ZeroShotAudioClassificationOutput, error)
- func (p *ZeroShotAudioClassificationPipeline) RunWithAudio(ctx context.Context, inputs [][]float32) (*ZeroShotAudioClassificationOutput, error)
- func (p *ZeroShotAudioClassificationPipeline) Validate() error
- type ZeroShotAudioClassificationResult
- type ZeroShotClassificationOutput
- type ZeroShotClassificationPipeline
- func (p *ZeroShotClassificationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *ZeroShotClassificationPipeline) GetModel() *backends.Model
- func (p *ZeroShotClassificationPipeline) GetStatistics() backends.PipelineStatistics
- func (p *ZeroShotClassificationPipeline) IsGenerative() bool
- func (p *ZeroShotClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
- func (p *ZeroShotClassificationPipeline) RunPipeline(ctx context.Context, inputs []string) (*ZeroShotOutput, error)
- func (p *ZeroShotClassificationPipeline) RunSingle(ctx context.Context, input string) (*ZeroShotOutput, error)
- func (p *ZeroShotClassificationPipeline) Validate() error
- type ZeroShotImageClassificationOutput
- type ZeroShotImageClassificationPipeline
- func (p *ZeroShotImageClassificationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *ZeroShotImageClassificationPipeline) GetModel() *backends.Model
- func (p *ZeroShotImageClassificationPipeline) GetStatistics() backends.PipelineStatistics
- func (p *ZeroShotImageClassificationPipeline) IsGenerative() bool
- func (p *ZeroShotImageClassificationPipeline) Run(context.Context, []string) (backends.PipelineBatchOutput, error)
- func (p *ZeroShotImageClassificationPipeline) RunWithImageText(ctx context.Context, inputs []backends.ImageTextInput) (*ZeroShotImageClassificationOutput, error)
- func (p *ZeroShotImageClassificationPipeline) RunWithImagesAndLabels(ctx context.Context, images []image.Image, labels []string) (*ZeroShotImageClassificationOutput, error)
- func (p *ZeroShotImageClassificationPipeline) Validate() error
- type ZeroShotImageClassificationResult
- type ZeroShotObjectDetectionOutput
- type ZeroShotObjectDetectionPipeline
- func (p *ZeroShotObjectDetectionPipeline) IsGenerative() bool
- func (p *ZeroShotObjectDetectionPipeline) Run(context.Context, []string) (backends.PipelineBatchOutput, error)
- func (p *ZeroShotObjectDetectionPipeline) RunWithImagesAndLabels(ctx context.Context, inputs []image.Image, labels []string) (*ZeroShotObjectDetectionOutput, error)
- func (p *ZeroShotObjectDetectionPipeline) RunWithLabels(ctx context.Context, inputs []string, labels []string) (*ZeroShotObjectDetectionOutput, error)
- func (p *ZeroShotObjectDetectionPipeline) Validate() error
- type ZeroShotOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderDecisionState ¶ added in v0.8.6
RenderDecisionState renders a structured state as decision models take a JSON state: indented JSON with non-ASCII characters left as they are. Object keys follow Go's encoding (struct field order, or sorted map keys), so use a struct when key order matters.
func WithASRBlankID ¶ added in v0.8.1
func WithASRBlankID(id int) backends.PipelineOption[*AutomaticSpeechRecognitionPipeline]
func WithASRPrompt ¶ added in v0.8.6
func WithASRPrompt(prompt string) backends.PipelineOption[*AutomaticSpeechRecognitionPipeline]
WithASRPrompt sets the model-specific user prompt used for generative ASR.
func WithASRSampleRate ¶ added in v0.8.1
func WithASRSampleRate(sampleRate int) backends.PipelineOption[*AutomaticSpeechRecognitionPipeline]
WithASRSampleRate sets the sample rate expected by the model.
func WithASRStreamingOptions ¶ added in v0.9.0
func WithASRStreamingOptions(opts StreamingASROptions) backends.PipelineOption[*AutomaticSpeechRecognitionPipeline]
WithASRStreamingOptions configures a package loaded with WithGenAIStreamingASR. ChunkSamples must be the package's maximum chunk size at its native sample rate.
func WithAudioClassificationSampleRate ¶ added in v0.8.1
func WithAudioClassificationSampleRate(sampleRate int) backends.PipelineOption[*AudioClassificationPipeline]
WithAudioClassificationSampleRate sets the sample rate expected by the model.
func WithAudioTopK ¶ added in v0.8.1
func WithAudioTopK(topK int) backends.PipelineOption[*AudioClassificationPipeline]
WithAudioTopK sets the number of classifications returned per waveform.
func WithAverageAggregation ¶ added in v0.3.4
func WithAverageAggregation() backends.PipelineOption[*TokenClassificationPipeline]
WithAverageAggregation sets the aggregation strategy for the token labels to average It reproduces simple aggregation from the huggingface implementation.
func WithBackgroundRemovalOutput ¶ added in v0.8.1
func WithBackgroundRemovalOutput(name string) backends.PipelineOption[*BackgroundRemovalPipeline]
func WithBatchSize ¶ added in v0.5.0
func WithBatchSize(size int) backends.PipelineOption[*CrossEncoderPipeline]
func WithBoxesOutput ¶ added in v0.6.0
func WithBoxesOutput(name string) backends.PipelineOption[*ObjectDetectionPipeline]
func WithClassification ¶ added in v0.6.2
func WithClassification() backends.PipelineOption[*TabularPipeline]
func WithDecisionMaxBatchRows ¶ added in v0.8.6
func WithDecisionMaxBatchRows(n int) backends.PipelineOption[*DecisionPipeline]
WithDecisionMaxBatchRows caps the (state, question) rows per forward pass.
func WithDecisionMaxBatchTokens ¶ added in v0.8.6
func WithDecisionMaxBatchTokens(n int) backends.PipelineOption[*DecisionPipeline]
WithDecisionMaxBatchTokens caps a forward pass's padded size, rows times longest row.
func WithDecisionQuestions ¶ added in v0.8.6
func WithDecisionQuestions(questions map[string]DecisionQuestion) backends.PipelineOption[*DecisionPipeline]
WithDecisionQuestions sets the questions Run asks of every input.
func WithDetectionIouThreshold ¶ added in v0.6.0
func WithDetectionIouThreshold(th float32) backends.PipelineOption[*ObjectDetectionPipeline]
func WithDetectionScoreThreshold ¶ added in v0.6.0
func WithDetectionScoreThreshold(th float32) backends.PipelineOption[*ObjectDetectionPipeline]
func WithDetectionTopK ¶ added in v0.6.0
func WithDetectionTopK(k int) backends.PipelineOption[*ObjectDetectionPipeline]
func WithEnableThinking ¶ added in v0.8.6
func WithEnableThinking(enabled bool) backends.PipelineOption[*TextGenerationPipeline]
WithEnableThinking controls the chat template's enable_thinking argument for every call made by this pipeline. Engine mode does not support this option.
func WithFillMaskTopK ¶ added in v0.8.1
func WithFillMaskTopK(topK int) backends.PipelineOption[*FillMaskPipeline]
func WithFirstAggregation ¶ added in v0.3.4
func WithFirstAggregation() backends.PipelineOption[*TokenClassificationPipeline]
WithFirstAggregation sets the aggregation strategy for the token labels to first It reproduces first aggregation from the huggingface implementation.
func WithFixedPadding ¶ added in v0.5.1
func WithFixedPadding(fixedPaddingLength int) backends.PipelineOption[*TextClassificationPipeline]
func WithGroundedThresholds ¶ added in v0.8.3
func WithGroundedThresholds(box, text float32) backends.PipelineOption[*GroundedObjectDetectionPipeline]
func WithGuidance ¶ added in v0.7.0
func WithGuidance(guidance *backends.Guidance) backends.PipelineOption[*TextGenerationPipeline]
WithGuidance enables constrained (guided) generation using a lark grammar, JSON schema, or regex.
func WithHypothesisTemplate ¶ added in v0.1.4
func WithHypothesisTemplate(hypothesisTemplate string) backends.PipelineOption[*ZeroShotClassificationPipeline]
WithHypothesisTemplate can be used to set the hypothesis template for classification.
func WithIDLabelMap ¶ added in v0.6.2
func WithIDLabelMap(labels map[int]string) backends.PipelineOption[*TabularPipeline]
func WithIgnoreLabels ¶
func WithIgnoreLabels(ignoreLabels []string) backends.PipelineOption[*TokenClassificationPipeline]
func WithImageCLSToken ¶ added in v0.8.3
func WithImageCLSToken() backends.PipelineOption[*ImageFeatureExtractionPipeline]
WithImageCLSToken reads token 0 of a rank-three hidden state. DINOv2's embed_image uses that token. The default remains a mean over every token. A pooled vector is an error.
func WithImageEmbeddingNormalization ¶ added in v0.8.1
func WithImageEmbeddingNormalization() backends.PipelineOption[*ImageFeatureExtractionPipeline]
func WithImageLabels ¶ added in v0.8.1
func WithImageLabels(labels []string) backends.PipelineOption[*ZeroShotImageClassificationPipeline]
func WithImageMode ¶ added in v0.6.0
func WithImageMode() backends.PipelineOption[*FeatureExtractionPipeline]
WithImageMode enables image feature extraction mode for vision encoders (e.g., CLIP visual encoder). When enabled, the pipeline accepts images instead of text and skips tokenization.
func WithImageModelPooler ¶ added in v0.8.2
func WithImageModelPooler() backends.PipelineOption[*ImageFeatureExtractionPipeline]
WithImageModelPooler selects the model's rank-two pooler_output. The default pools rank-three hidden states with an arithmetic mean, not the model pooler.
func WithImageTopK ¶ added in v0.8.1
func WithImageTopK(k int) backends.PipelineOption[*ZeroShotImageClassificationPipeline]
func WithLabels ¶ added in v0.1.4
func WithLabels(labels []string) backends.PipelineOption[*ZeroShotClassificationPipeline]
WithLabels can be used to set the labels to classify the examples.
func WithMaskToken ¶ added in v0.8.1
func WithMaskToken(token string) backends.PipelineOption[*FillMaskPipeline]
func WithMaxAggregation ¶ added in v0.3.4
func WithMaxAggregation() backends.PipelineOption[*TokenClassificationPipeline]
WithMaxAggregation sets the aggregation strategy for the token labels to Max It reproduces max aggregation from the huggingface implementation.
func WithMaxLength ¶ added in v0.6.0
func WithMaxLength(maxLength int) backends.PipelineOption[*TextGenerationPipeline]
WithMaxLength allows the user to define the maximum generated tokens.
func WithModelPooler ¶ added in v0.8.2
func WithModelPooler() backends.PipelineOption[*FeatureExtractionPipeline]
WithModelPooler selects the model's rank-two pooler_output instead of mean pooling hidden states. Models without that output are rejected.
func WithMultiLabel ¶ added in v0.0.9
func WithMultiLabel() backends.PipelineOption[*TextClassificationPipeline]
func WithMultilabel ¶ added in v0.1.4
func WithMultilabel(multilabel bool) backends.PipelineOption[*ZeroShotClassificationPipeline]
WithMultilabel can be used to set whether the pipeline is multilabel.
func WithNCHWFormat ¶ added in v0.5.7
func WithNCHWFormat[T imagePipeline]() backends.PipelineOption[T]
func WithNHWCFormat ¶ added in v0.5.7
func WithNHWCFormat[T imagePipeline]() backends.PipelineOption[T]
func WithNormalization ¶ added in v0.1.1
func WithNormalization() backends.PipelineOption[*FeatureExtractionPipeline]
WithNormalization applies normalization to the mean pooled output of the feature pipeline.
func WithNormalizationSteps ¶ added in v0.5.0
func WithNormalizationSteps[T imagePipeline](steps ...imageutil.NormalizationStep) backends.PipelineOption[T]
func WithOutputName ¶ added in v0.1.4
func WithOutputName(outputName string) backends.PipelineOption[*FeatureExtractionPipeline]
WithOutputName if there are multiple outputs from the underlying model, which output should be returned. If not passed, the first output from the feature pipeline is returned.
func WithPreprocessSteps ¶ added in v0.5.0
func WithPreprocessSteps[T imagePipeline](steps ...imageutil.PreprocessStep) backends.PipelineOption[T]
WithPreprocessSteps is a unified option to add image preprocessing steps to any pipeline that supports them (e.g., FeatureExtractionPipeline in image mode and ImageClassificationPipeline). This avoids conflicting option names.
func WithRegression ¶ added in v0.6.2
func WithRegression() backends.PipelineOption[*TabularPipeline]
func WithScoreThreshold ¶ added in v0.5.0
func WithScoreThreshold(threshold float32) backends.PipelineOption[*CrossEncoderPipeline]
func WithScoresOutput ¶ added in v0.6.0
func WithScoresOutput(name string) backends.PipelineOption[*ObjectDetectionPipeline]
func WithSeed ¶ added in v0.6.3
func WithSeed(seed int) backends.PipelineOption[*TextGenerationPipeline]
func WithSegmentationLogitsOutput ¶ added in v0.8.1
func WithSegmentationLogitsOutput(name string) backends.PipelineOption[*ImageSegmentationPipeline]
func WithSegmentationScoreThreshold ¶ added in v0.8.1
func WithSegmentationScoreThreshold(threshold float32) backends.PipelineOption[*ImageSegmentationPipeline]
func WithSigmoid ¶ added in v0.0.9
func WithSigmoid() backends.PipelineOption[*TextClassificationPipeline]
func WithSimpleAggregation ¶
func WithSimpleAggregation() backends.PipelineOption[*TokenClassificationPipeline]
WithSimpleAggregation sets the aggregation strategy for the token labels to simple It reproduces simple aggregation from the huggingface implementation.
func WithSingleLabel ¶ added in v0.0.9
func WithSingleLabel() backends.PipelineOption[*TextClassificationPipeline]
func WithSoftmax ¶ added in v0.0.9
func WithSoftmax() backends.PipelineOption[*TextClassificationPipeline]
func WithSortResults ¶ added in v0.5.0
func WithSortResults() backends.PipelineOption[*CrossEncoderPipeline]
func WithSplitWords ¶ added in v0.5.9
func WithSplitWords() backends.PipelineOption[*TokenClassificationPipeline]
WithSplitWords enables word-level alignment like Hugging Face's is_split_into_words.
func WithStopSequences ¶ added in v0.6.3
func WithStopSequences(stopSequences []string) backends.PipelineOption[*TextGenerationPipeline]
WithStopSequences allows the user to define stop sequences that will end the generation when encountered. If the model produces any of the provided strings in the output, generation for that sequence will stop and the stop string will be excluded.
func WithStreaming ¶ added in v0.6.0
func WithStreaming() backends.PipelineOption[*TextGenerationPipeline]
WithStreaming allows the user to receive generated tokens as a stream instead of waiting for the entire response.
func WithSystemPrompt ¶ added in v0.6.2
func WithSystemPrompt(systemPrompt string) backends.PipelineOption[*TextGenerationPipeline]
WithSystemPrompt allows the user to define a system prompt that will be prepended to every input.
func WithTabularSigmoid ¶ added in v0.6.2
func WithTabularSigmoid() backends.PipelineOption[*TabularPipeline]
func WithTabularSoftmax ¶ added in v0.6.2
func WithTabularSoftmax() backends.PipelineOption[*TabularPipeline]
func WithTemperature ¶ added in v0.6.3
func WithTemperature(temperature float64) backends.PipelineOption[*TextGenerationPipeline]
func WithTools ¶ added in v0.7.0
func WithTools(tools []string) backends.PipelineOption[*TextGenerationPipeline]
WithTools sets the list of Hermes-style tool definition JSON strings to include in the chat template.
func WithTopK ¶ added in v0.5.0
func WithTopK(topK int) backends.PipelineOption[*ImageClassificationPipeline]
WithTopK sets the number of top classifications to return.
func WithTopP ¶ added in v0.6.3
func WithTopP(topP float64) backends.PipelineOption[*TextGenerationPipeline]
func WithWordSplitter ¶ added in v0.8.4
func WithWordSplitter(splitter WordSplitter) backends.PipelineOption[*TokenClassificationPipeline]
WithWordSplitter splits every input with splitter before labelling it, and implies WithSplitWords: Run labels the words the splitter returns, exactly as RunWords would label the same words.
Give the trainer the same option (TrainerConfig.PipelineOptions) and write the training examples as raw text: the token classification dataset then splits them with this splitter too, so training and inference cannot split differently. A splitter is code, not part of the saved model, so it must be passed again wherever the fine-tuned model is loaded.
func WithZeroShotObjectLabels ¶ added in v0.8.1
func WithZeroShotObjectLabels(labels []string) backends.PipelineOption[*ZeroShotObjectDetectionPipeline]
func WithoutAggregation ¶
func WithoutAggregation() backends.PipelineOption[*TokenClassificationPipeline]
WithoutAggregation returns the token labels.
Types ¶
type ASRTimestamp ¶ added in v0.8.6
type ASRTimestamp = backends.ASRTimestamp
ASRTimestamp identifies the text and time range of a recognized word or segment.
type AddressParseAddress ¶ added in v0.8.3
type AddressParseAddress struct {
Address string
CleanedAddress string
Words []AddressParseWord
Components []AddressParseComponent
}
AddressParseAddress contains word-level predictions and adjacent parsed fields.
func (AddressParseAddress) ToFields ¶ added in v0.8.3
func (a AddressParseAddress) ToFields() map[string]string
ToFields combines adjacent components with the same tag into a convenient tag-to-value map. Repeated fields are joined with a space.
type AddressParseComponent ¶ added in v0.8.3
AddressParseComponent groups adjacent words with the same predicted tag.
type AddressParseConfig ¶ added in v0.8.3
type AddressParseConfig = backends.PipelineConfig[*AddressParsePipeline]
type AddressParseOption ¶ added in v0.8.3
type AddressParseOption = backends.PipelineOption[*AddressParsePipeline]
func WithAddressParseBatchSize ¶ added in v0.8.3
func WithAddressParseBatchSize(size int) AddressParseOption
WithAddressParseBatchSize limits the number of addresses processed in each inference batch. The default is 32.
func WithAddressParseHyphenSplit ¶ added in v0.8.3
func WithAddressParseHyphenSplit() AddressParseOption
WithAddressParseHyphenSplit enables splitting a leading unit/street-number pair such as "3-305 Main Street" into "3 305 Main Street".
func WithAddressParseManifestFilename ¶ added in v0.8.3
func WithAddressParseManifestFilename(filename string) AddressParseOption
WithAddressParseManifestFilename selects a manifest relative to the model directory.
func WithAddressParsePreprocessors ¶ added in v0.8.3
func WithAddressParsePreprocessors(processors ...AddressParsePreprocessor) AddressParseOption
WithAddressParsePreprocessors applies each processor in order before built-in address cleaning. Nil processors are ignored.
func WithAddressParseProbabilities ¶ added in v0.8.3
func WithAddressParseProbabilities(enabled bool) AddressParseOption
WithAddressParseProbabilities controls whether word prediction scores are included. Scores are enabled by default for backwards compatibility.
func WithAddressParseProbabilityRounding ¶ added in v0.8.3
func WithAddressParseProbabilityRounding(digits int) AddressParseOption
WithAddressParseProbabilityRounding rounds included scores to digits decimal places using ties-to-even rounding. A negative value disables rounding; values from 0 through 9 are supported.
type AddressParseOutput ¶ added in v0.8.3
type AddressParseOutput struct {
Addresses []AddressParseAddress
}
AddressParseOutput is the typed result for one batch of addresses.
func (*AddressParseOutput) GetOutput ¶ added in v0.8.3
func (o *AddressParseOutput) GetOutput() []any
type AddressParsePipeline ¶ added in v0.8.3
type AddressParsePipeline struct {
*backends.BasePipeline
Encoder *backends.Model
Decoder *backends.Model
HyphenSplit bool
ManifestFilename string
// contains filtered or unexported fields
}
AddressParsePipeline runs AddressParse's BPEmb model using separate embedder, encoder, and decoder-step ONNX graphs.
func NewAddressParsePipeline ¶ added in v0.8.3
func NewAddressParsePipeline(ctx context.Context, config AddressParseConfig, model *backends.Model) (*AddressParsePipeline, error)
NewAddressParsePipeline initializes a AddressParse export bundle.
func (*AddressParsePipeline) GetMetadata ¶ added in v0.8.3
func (p *AddressParsePipeline) GetMetadata() backends.PipelineMetadata
func (*AddressParsePipeline) GetModel ¶ added in v0.8.3
func (p *AddressParsePipeline) GetModel() *backends.Model
func (*AddressParsePipeline) GetStatistics ¶ added in v0.8.3
func (p *AddressParsePipeline) GetStatistics() backends.PipelineStatistics
func (*AddressParsePipeline) IsGenerative ¶ added in v0.8.3
func (*AddressParsePipeline) IsGenerative() bool
func (*AddressParsePipeline) Run ¶ added in v0.8.3
func (p *AddressParsePipeline) Run(ctx context.Context, addresses []string) (backends.PipelineBatchOutput, error)
Run implements the common pipeline interface for a batch of addresses.
func (*AddressParsePipeline) RunAddresses ¶ added in v0.8.3
func (p *AddressParsePipeline) RunAddresses(ctx context.Context, addresses []string) (*AddressParseOutput, error)
RunAddresses parses a batch of raw street addresses.
func (*AddressParsePipeline) Validate ¶ added in v0.8.3
func (p *AddressParsePipeline) Validate() error
type AddressParsePreprocessor ¶ added in v0.8.3
AddressParsePreprocessor transforms an address before AddressParse's built-in lowercase, comma removal, whitespace normalization, and optional hyphen split.
type AddressParseWord ¶ added in v0.8.3
AddressParseWord is a word-level prediction from the address parser.
type AnyToAnyConfig ¶ added in v0.8.4
type AnyToAnyConfig = backends.PipelineConfig[*AnyToAnyPipeline]
type AnyToAnyEvent ¶ added in v0.8.4
type AnyToAnyEvent struct {
Sequence int
Type string // text, image, audio or done
Text string
Image image.Image
Audio *AudioWaveform
}
AnyToAnyEvent carries a text delta or a complete generated media artifact. Events for each conversation are ordered; Sequence identifies the batch item. Audio is emitted after codec reconstruction, not as speculative PCM chunks.
type AnyToAnyOption ¶ added in v0.8.4
type AnyToAnyOption = backends.PipelineOption[*AnyToAnyPipeline]
func WithAnyToAnyGenerationMode ¶ added in v0.8.4
func WithAnyToAnyGenerationMode(mode string) AnyToAnyOption
WithAnyToAnyGenerationMode requests text, image, audio or interleaved output. Available modes depend on the selected model family.
func WithAnyToAnyGuidance ¶ added in v0.8.4
func WithAnyToAnyGuidance(guidance *backends.Guidance) AnyToAnyOption
WithAnyToAnyGuidance enables constrained text generation for Phi-4's GenAI session.
func WithAnyToAnyMaxLength ¶ added in v0.8.4
func WithAnyToAnyMaxLength(n int) AnyToAnyOption
func WithAnyToAnyMaxNewTokens ¶ added in v0.8.4
func WithAnyToAnyMaxNewTokens(n int) AnyToAnyOption
func WithAnyToAnyStreaming ¶ added in v0.8.4
func WithAnyToAnyStreaming() AnyToAnyOption
func WithAnyToAnySystemPrompt ¶ added in v0.8.4
func WithAnyToAnySystemPrompt(prompt string) AnyToAnyOption
func WithAnyToAnyTools ¶ added in v0.8.4
func WithAnyToAnyTools(tools []string) AnyToAnyOption
WithAnyToAnyTools sets Hermes-style tool definitions for Phi-4's GenAI chat template. The pipeline returns generated tool-call text; applications execute tools themselves.
func WithAnyToAnyVideoDecoder ¶ added in v0.8.4
func WithAnyToAnyVideoDecoder(decoder VideoDecoder, maxFrames int) AnyToAnyOption
WithAnyToAnyVideoDecoder sets the optional file decoder and the explicit maximum prefix frame count. Decoded inputs exceeding that limit are rejected.
type AnyToAnyOutput ¶ added in v0.8.4
type AnyToAnyOutput struct {
Responses []string
Results []AnyToAnyResult
TokenStream chan backends.SequenceDelta
EventStream chan AnyToAnyEvent
ErrorStream chan error
}
func (*AnyToAnyOutput) GetOutput ¶ added in v0.8.4
func (o *AnyToAnyOutput) GetOutput() []any
type AnyToAnyPipeline ¶ added in v0.8.4
type AnyToAnyPipeline struct {
VideoDecoder VideoDecoder
VideoFrameLimit int
GenerationMode string
MaxNewTokens int
// contains filtered or unexported fields
}
AnyToAnyPipeline supports Phi-4 multimodal understanding and native Janus/LFM media generation. Input and output modalities depend on the model family; see PIPELINE_SUPPORT.md for the verified graph contracts.
func NewAnyToAnyPipeline ¶ added in v0.8.4
func NewAnyToAnyPipeline(ctx context.Context, config AnyToAnyConfig, model *backends.Model) (*AnyToAnyPipeline, error)
func (AnyToAnyPipeline) GetMetadata ¶ added in v0.8.4
func (p AnyToAnyPipeline) GetMetadata() backends.PipelineMetadata
func (*AnyToAnyPipeline) GetStatistics ¶ added in v0.8.4
func (p *AnyToAnyPipeline) GetStatistics() backends.PipelineStatistics
func (*AnyToAnyPipeline) IsGenerative ¶ added in v0.8.4
func (*AnyToAnyPipeline) IsGenerative() bool
func (*AnyToAnyPipeline) Run ¶ added in v0.8.4
func (p *AnyToAnyPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*AnyToAnyPipeline) RunConversations ¶ added in v0.8.4
func (p *AnyToAnyPipeline) RunConversations(ctx context.Context, inputs [][]MultimodalMessage) (*AnyToAnyOutput, error)
func (*AnyToAnyPipeline) RunMessages ¶ added in v0.8.4
func (p *AnyToAnyPipeline) RunMessages(ctx context.Context, inputs [][]backends.Message) (*AnyToAnyOutput, error)
RunMessages accepts conversations with attachments or ordered ContentBlocks. Phi-4 produces text; native bundles select media with GenerationMode. Audio inputs must use the format accepted by the selected model's processor.
func (*AnyToAnyPipeline) Validate ¶ added in v0.8.4
func (p *AnyToAnyPipeline) Validate() error
type AnyToAnyResult ¶ added in v0.8.4
type AnyToAnyResult struct {
Text string
Images []image.Image
Audio *AudioWaveform
}
AnyToAnyResult owns a generated response. Audio samples use Audio.SampleRate; images are decoded RGB pixels. Model capabilities determine populated fields.
type AudioClassificationOutput ¶ added in v0.8.1
type AudioClassificationOutput struct {
Predictions [][]AudioClassificationResult
}
func (*AudioClassificationOutput) GetOutput ¶ added in v0.8.1
func (o *AudioClassificationOutput) GetOutput() []any
type AudioClassificationPipeline ¶ added in v0.8.1
type AudioClassificationPipeline struct {
*backends.BasePipeline
IDLabelMap map[int]string
Input backends.InputOutputInfo
TopK int
SampleRate int
}
AudioClassificationPipeline classifies mono audio waveforms.
func NewAudioClassificationPipeline ¶ added in v0.8.1
func NewAudioClassificationPipeline(ctx context.Context, config backends.PipelineConfig[*AudioClassificationPipeline], model *backends.Model) (*AudioClassificationPipeline, error)
func (*AudioClassificationPipeline) GetMetadata ¶ added in v0.8.1
func (p *AudioClassificationPipeline) GetMetadata() backends.PipelineMetadata
func (*AudioClassificationPipeline) GetModel ¶ added in v0.8.1
func (p *AudioClassificationPipeline) GetModel() *backends.Model
func (*AudioClassificationPipeline) GetStatistics ¶ added in v0.8.1
func (p *AudioClassificationPipeline) GetStatistics() backends.PipelineStatistics
func (*AudioClassificationPipeline) IsGenerative ¶ added in v0.8.1
func (p *AudioClassificationPipeline) IsGenerative() bool
func (*AudioClassificationPipeline) Run ¶ added in v0.8.1
func (p *AudioClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
Run executes the pipeline on PCM WAV file paths.
func (*AudioClassificationPipeline) RunFiles ¶ added in v0.8.1
func (p *AudioClassificationPipeline) RunFiles(ctx context.Context, paths []string) (*AudioClassificationOutput, error)
func (*AudioClassificationPipeline) RunWaveforms ¶ added in v0.8.1
func (p *AudioClassificationPipeline) RunWaveforms(ctx context.Context, inputs []AudioWaveform) (*AudioClassificationOutput, error)
func (*AudioClassificationPipeline) RunWithAudio ¶ added in v0.8.1
func (p *AudioClassificationPipeline) RunWithAudio(ctx context.Context, inputs [][]float32) (*AudioClassificationOutput, error)
RunWithAudio executes mono samples already sampled at the pipeline's configured SampleRate.
func (*AudioClassificationPipeline) Validate ¶ added in v0.8.1
func (p *AudioClassificationPipeline) Validate() error
type AudioClassificationResult ¶ added in v0.8.1
type AudioWaveform ¶ added in v0.8.1
AudioWaveform is a mono waveform and its sampling rate. Samples are expected to be normalized to the range [-1, 1].
type AutomaticSpeechRecognitionOutput ¶ added in v0.8.1
type AutomaticSpeechRecognitionOutput struct {
Text []string
Words [][]string
WordTimestamps [][]ASRTimestamp
SegmentTimestamps [][]ASRTimestamp
}
AutomaticSpeechRecognitionOutput contains one transcription per waveform.
func (*AutomaticSpeechRecognitionOutput) GetOutput ¶ added in v0.8.1
func (o *AutomaticSpeechRecognitionOutput) GetOutput() []any
type AutomaticSpeechRecognitionPipeline ¶ added in v0.8.1
type AutomaticSpeechRecognitionPipeline struct {
*backends.BasePipeline
IDLabelMap map[int]string
BlankID int
Input backends.InputOutputInfo
SampleRate int
Prompt string
StreamingOptions StreamingASROptions
}
AutomaticSpeechRecognitionPipeline recognizes speech with CTC or a GenAI model.
func NewAutomaticSpeechRecognitionPipeline ¶ added in v0.8.1
func NewAutomaticSpeechRecognitionPipeline(ctx context.Context, config backends.PipelineConfig[*AutomaticSpeechRecognitionPipeline], model *backends.Model) (*AutomaticSpeechRecognitionPipeline, error)
func (*AutomaticSpeechRecognitionPipeline) GetMetadata ¶ added in v0.8.1
func (p *AutomaticSpeechRecognitionPipeline) GetMetadata() backends.PipelineMetadata
func (*AutomaticSpeechRecognitionPipeline) GetModel ¶ added in v0.8.1
func (p *AutomaticSpeechRecognitionPipeline) GetModel() *backends.Model
func (*AutomaticSpeechRecognitionPipeline) GetStatistics ¶ added in v0.8.1
func (p *AutomaticSpeechRecognitionPipeline) GetStatistics() backends.PipelineStatistics
func (*AutomaticSpeechRecognitionPipeline) IsGenerative ¶ added in v0.8.1
func (p *AutomaticSpeechRecognitionPipeline) IsGenerative() bool
func (*AutomaticSpeechRecognitionPipeline) Run ¶ added in v0.8.1
func (p *AutomaticSpeechRecognitionPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*AutomaticSpeechRecognitionPipeline) RunAudioStream ¶ added in v0.9.0
func (p *AutomaticSpeechRecognitionPipeline) RunAudioStream(ctx context.Context, chunks <-chan []float32) (<-chan backends.ASRResult, <-chan error, error)
RunAudioStream accepts mono PCM at SampleRate and emits incremental transcript fragments. Ownership of each chunk transfers to the pipeline; do not mutate it. Chunks larger than ChunkSamples are split automatically. Close chunks to flush the stream, and consume both output channels until closed. Cancel ctx to stop early.
func (*AutomaticSpeechRecognitionPipeline) RunFiles ¶ added in v0.8.1
func (p *AutomaticSpeechRecognitionPipeline) RunFiles(ctx context.Context, paths []string) (*AutomaticSpeechRecognitionOutput, error)
func (*AutomaticSpeechRecognitionPipeline) RunWaveforms ¶ added in v0.8.1
func (p *AutomaticSpeechRecognitionPipeline) RunWaveforms(ctx context.Context, inputs []AudioWaveform) (*AutomaticSpeechRecognitionOutput, error)
func (*AutomaticSpeechRecognitionPipeline) RunWithAudio ¶ added in v0.8.1
func (p *AutomaticSpeechRecognitionPipeline) RunWithAudio(ctx context.Context, inputs [][]float32) (*AutomaticSpeechRecognitionOutput, error)
RunWithAudio executes mono samples already sampled at the pipeline's configured SampleRate.
func (*AutomaticSpeechRecognitionPipeline) SupportsGenerativeModelLoading ¶ added in v0.8.6
func (*AutomaticSpeechRecognitionPipeline) SupportsGenerativeModelLoading() bool
SupportsGenerativeModelLoading allows callers to select GenAI explicitly while keeping ONNX/CTC as the default loading mode for this pipeline.
func (*AutomaticSpeechRecognitionPipeline) Validate ¶ added in v0.8.1
func (p *AutomaticSpeechRecognitionPipeline) Validate() error
type BackgroundRemovalOutput ¶ added in v0.8.1
type BackgroundRemovalOutput struct{ Results []BackgroundRemovalResult }
func (*BackgroundRemovalOutput) GetOutput ¶ added in v0.8.1
func (o *BackgroundRemovalOutput) GetOutput() []any
type BackgroundRemovalPipeline ¶ added in v0.8.1
type BackgroundRemovalPipeline struct {
*backends.BasePipeline
OutputName string
// contains filtered or unexported fields
}
BackgroundRemovalPipeline is a Hugot extension for foreground alpha prediction.
func NewBackgroundRemovalPipeline ¶ added in v0.8.1
func NewBackgroundRemovalPipeline(ctx context.Context, config backends.PipelineConfig[*BackgroundRemovalPipeline], model *backends.Model) (*BackgroundRemovalPipeline, error)
func (*BackgroundRemovalPipeline) GetMetadata ¶ added in v0.8.1
func (p *BackgroundRemovalPipeline) GetMetadata() backends.PipelineMetadata
func (*BackgroundRemovalPipeline) GetModel ¶ added in v0.8.1
func (p *BackgroundRemovalPipeline) GetModel() *backends.Model
func (*BackgroundRemovalPipeline) GetStatistics ¶ added in v0.8.1
func (p *BackgroundRemovalPipeline) GetStatistics() backends.PipelineStatistics
func (*BackgroundRemovalPipeline) IsGenerative ¶ added in v0.8.1
func (p *BackgroundRemovalPipeline) IsGenerative() bool
func (*BackgroundRemovalPipeline) Run ¶ added in v0.8.1
func (p *BackgroundRemovalPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*BackgroundRemovalPipeline) RunPipeline ¶ added in v0.8.1
func (p *BackgroundRemovalPipeline) RunPipeline(ctx context.Context, inputs []string) (*BackgroundRemovalOutput, error)
func (*BackgroundRemovalPipeline) RunWithImages ¶ added in v0.8.1
func (p *BackgroundRemovalPipeline) RunWithImages(ctx context.Context, inputs []image.Image) (*BackgroundRemovalOutput, error)
func (*BackgroundRemovalPipeline) Validate ¶ added in v0.8.1
func (p *BackgroundRemovalPipeline) Validate() error
type BackgroundRemovalResult ¶ added in v0.8.1
type ClassificationOutput ¶
type CrossEncoderOutput ¶ added in v0.5.0
type CrossEncoderOutput struct {
Results []CrossEncoderResult
}
func (*CrossEncoderOutput) GetOutput ¶ added in v0.5.0
func (t *CrossEncoderOutput) GetOutput() []any
type CrossEncoderPipeline ¶ added in v0.5.0
type CrossEncoderPipeline struct {
*backends.BasePipeline
// contains filtered or unexported fields
}
func NewCrossEncoderPipeline ¶ added in v0.5.0
func NewCrossEncoderPipeline(sessionContext context.Context, config backends.PipelineConfig[*CrossEncoderPipeline], model *backends.Model) (*CrossEncoderPipeline, error)
func (*CrossEncoderPipeline) GetMetadata ¶ added in v0.5.0
func (p *CrossEncoderPipeline) GetMetadata() backends.PipelineMetadata
func (*CrossEncoderPipeline) GetModel ¶ added in v0.5.0
func (p *CrossEncoderPipeline) GetModel() *backends.Model
func (*CrossEncoderPipeline) GetStatistics ¶ added in v0.5.9
func (p *CrossEncoderPipeline) GetStatistics() backends.PipelineStatistics
func (*CrossEncoderPipeline) IsGenerative ¶ added in v0.6.0
func (p *CrossEncoderPipeline) IsGenerative() bool
func (*CrossEncoderPipeline) Run ¶ added in v0.5.0
func (p *CrossEncoderPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*CrossEncoderPipeline) RunPipeline ¶ added in v0.5.0
func (p *CrossEncoderPipeline) RunPipeline(ctx context.Context, query string, documents []string) (*CrossEncoderOutput, error)
func (*CrossEncoderPipeline) Validate ¶ added in v0.5.0
func (p *CrossEncoderPipeline) Validate() error
type CrossEncoderResult ¶ added in v0.5.0
type CrossEncoderStatistics ¶ added in v0.5.9
type DecisionAnswer ¶ added in v0.8.6
type DecisionAnswer struct {
Type DecisionQuestionType
// Probabilities over the options, keyed by option name: "false"/"true" for noul,
// the option names for choice, the level index ("0", "1", ...) for score.
Probabilities map[string]float64
// Noul is P(true), set for noul questions.
Noul float64
// Choice is the most probable option, set for choice questions.
Choice string
// Score is the expected level index, set for score questions.
Score float64
// Confidence is 0 for a uniform and 1 for a one-hot distribution (choice), or how
// tightly the mass clusters on the scale (score). Noul has none: P(true) is it.
Confidence float64
}
DecisionAnswer is the model's answer to one question.
type DecisionCriterion ¶ added in v0.8.6
DecisionCriterion is one option of a question.
For a choice question, Name is the option's label and Description is optional. For a score question, Description is the level's rubric; Name is ignored, since levels are numbered 0..L-1 lowest first. For a noul question, criteria are optional and override the default description of "false" and/or "true" by Name.
type DecisionInput ¶ added in v0.8.6
type DecisionInput struct {
State string
Questions map[string]DecisionQuestion
}
DecisionInput is a state and the questions to ask of it. Use RenderDecisionState to turn a structured state into text.
type DecisionOutput ¶ added in v0.8.6
type DecisionOutput struct {
Results []DecisionResult
}
DecisionOutput holds one result per input, in input order.
func (*DecisionOutput) GetOutput ¶ added in v0.8.6
func (o *DecisionOutput) GetOutput() []any
type DecisionPipeline ¶ added in v0.8.6
type DecisionPipeline struct {
*backends.BasePipeline
// Questions are asked of every input passed to Run.
Questions map[string]DecisionQuestion
// MaxBatchRows caps how many (state, question) rows run in one forward pass.
MaxBatchRows int
// MaxBatchTokens caps a forward pass's padded size (rows x longest row), so a long
// state is not batched with short ones it would pad to its own length. A row longer
// than the budget still runs, alone.
MaxBatchTokens int
Config DecisionReadoutConfig
// contains filtered or unexported fields
}
DecisionPipeline runs decision models ("system one" models, as served behind the Jev API): instead of generating text, the model answers typed questions about a state (a text, or JSON). The question types are noul (yes/no), choice (one of N named options) and score (a level on an ordered scale). Options are given at request time, so any label set works without retraining.
The ONNX graph takes input_ids, attention_mask and option_index ([batch, options], the position of each option's last token) and returns per-option logits ([batch, options]); temperature, softmax and confidence are applied here. Prompt rendering follows the model's format; the Strands format (the strands* declarations at the end of this file) is the one supported today.
func NewDecisionPipeline ¶ added in v0.8.6
func NewDecisionPipeline(ctx context.Context, config backends.PipelineConfig[*DecisionPipeline], model *backends.Model) (*DecisionPipeline, error)
func (*DecisionPipeline) GetMetadata ¶ added in v0.8.6
func (p *DecisionPipeline) GetMetadata() backends.PipelineMetadata
func (*DecisionPipeline) GetModel ¶ added in v0.8.6
func (p *DecisionPipeline) GetModel() *backends.Model
func (*DecisionPipeline) GetStatistics ¶ added in v0.8.6
func (p *DecisionPipeline) GetStatistics() backends.PipelineStatistics
func (*DecisionPipeline) IsGenerative ¶ added in v0.8.6
func (*DecisionPipeline) IsGenerative() bool
func (*DecisionPipeline) Run ¶ added in v0.8.6
func (p *DecisionPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
Run asks the pipeline's configured questions (WithDecisionQuestions) of each input.
func (*DecisionPipeline) RunPipeline ¶ added in v0.8.6
func (p *DecisionPipeline) RunPipeline(ctx context.Context, inputs []DecisionInput) (*DecisionOutput, error)
RunPipeline answers each input's questions. Every (state, question) pair is one row; rows of similar length are batched together.
func (*DecisionPipeline) Validate ¶ added in v0.8.6
func (p *DecisionPipeline) Validate() error
type DecisionQuestion ¶ added in v0.8.6
type DecisionQuestion struct {
Type DecisionQuestionType
Instructions string
Criteria []DecisionCriterion
}
DecisionQuestion is one question asked of a state.
type DecisionQuestionType ¶ added in v0.8.6
type DecisionQuestionType string
DecisionQuestionType is one of the three decision primitives.
const ( // DecisionNoul is a yes/no question: is the statement true of the state? DecisionNoul DecisionQuestionType = "noul" // DecisionChoice selects exactly one of N named options. DecisionChoice DecisionQuestionType = "choice" // DecisionScore rates the state on an ordered scale of 2 to 10 levels. DecisionScore DecisionQuestionType = "score" )
type DecisionReadoutConfig ¶ added in v0.8.6
type DecisionReadoutConfig struct {
Temperature float64 `json:"temperature"`
TemperatureByKind map[string]float64 `json:"temperature_by_kind"`
OrdinalSmoothing float64 `json:"ordinal_smoothing"`
MaxLength int `json:"max_length"`
ForceBOS bool `json:"force_bos"`
HeadType string `json:"head_type"`
}
DecisionReadoutConfig holds the readout settings a decision model ships with: the fitted temperature per question type, the ordinal smoothing the score confidence corrects for, and the context length. Strands models ship it as strands_decider_config.json.
type DecisionResult ¶ added in v0.8.6
type DecisionResult struct {
Answers map[string]DecisionAnswer
}
DecisionResult holds one input's answers, keyed by question name.
type DepthEstimationConfig ¶ added in v0.8.1
type DepthEstimationConfig = backends.PipelineConfig[*DepthEstimationPipeline]
type DepthEstimationOption ¶ added in v0.8.1
type DepthEstimationOption = backends.PipelineOption[*DepthEstimationPipeline]
func WithDepthEstimationOutput ¶ added in v0.8.1
func WithDepthEstimationOutput(name string) DepthEstimationOption
WithDepthEstimationOutput is an explicit-name alias for WithDepthOutput.
func WithDepthOutput ¶ added in v0.8.1
func WithDepthOutput(name string) DepthEstimationOption
WithDepthOutput selects the model output containing predicted depth values.
type DepthEstimationOutput ¶ added in v0.8.1
type DepthEstimationOutput struct {
Results []DepthEstimationResult
}
func (*DepthEstimationOutput) GetOutput ¶ added in v0.8.1
func (o *DepthEstimationOutput) GetOutput() []any
type DepthEstimationPipeline ¶ added in v0.8.1
type DepthEstimationPipeline struct {
*backends.BasePipeline
DepthOutput string
// contains filtered or unexported fields
}
DepthEstimationPipeline estimates one depth value for each source-image pixel.
func NewDepthEstimationPipeline ¶ added in v0.8.1
func NewDepthEstimationPipeline(ctx context.Context, config DepthEstimationConfig, model *backends.Model) (*DepthEstimationPipeline, error)
func (*DepthEstimationPipeline) GetMetadata ¶ added in v0.8.1
func (p *DepthEstimationPipeline) GetMetadata() backends.PipelineMetadata
func (*DepthEstimationPipeline) GetModel ¶ added in v0.8.1
func (p *DepthEstimationPipeline) GetModel() *backends.Model
func (*DepthEstimationPipeline) GetStatistics ¶ added in v0.8.1
func (p *DepthEstimationPipeline) GetStatistics() backends.PipelineStatistics
func (*DepthEstimationPipeline) IsGenerative ¶ added in v0.8.1
func (p *DepthEstimationPipeline) IsGenerative() bool
func (*DepthEstimationPipeline) Run ¶ added in v0.8.1
func (p *DepthEstimationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*DepthEstimationPipeline) RunPipeline ¶ added in v0.8.1
func (p *DepthEstimationPipeline) RunPipeline(ctx context.Context, inputs []string) (*DepthEstimationOutput, error)
func (*DepthEstimationPipeline) RunWithImagePaths ¶ added in v0.8.1
func (p *DepthEstimationPipeline) RunWithImagePaths(ctx context.Context, paths []string) (*DepthEstimationOutput, error)
func (*DepthEstimationPipeline) RunWithImages ¶ added in v0.8.1
func (p *DepthEstimationPipeline) RunWithImages(ctx context.Context, images []image.Image) (*DepthEstimationOutput, error)
func (*DepthEstimationPipeline) Validate ¶ added in v0.8.1
func (p *DepthEstimationPipeline) Validate() error
type DepthEstimationResult ¶ added in v0.8.1
type DocumentQuestionAnsweringConfig ¶ added in v0.8.1
type DocumentQuestionAnsweringConfig = backends.PipelineConfig[*DocumentQuestionAnsweringPipeline]
type DocumentQuestionAnsweringInput ¶ added in v0.8.1
type DocumentQuestionAnsweringInput struct {
DocumentPath string
ImagePath string
Question string
Role string
History []backends.Message
}
DocumentQuestionAnsweringInput pairs a document with a question. Native Donut inference uses DocumentPath (or ImagePath as a fallback) and Question.
type DocumentQuestionAnsweringOption ¶ added in v0.8.1
type DocumentQuestionAnsweringOption = backends.PipelineOption[*DocumentQuestionAnsweringPipeline]
func WithDocumentQuestionAnsweringMaxLength ¶ added in v0.8.1
func WithDocumentQuestionAnsweringMaxLength(n int) DocumentQuestionAnsweringOption
func WithDocumentQuestionAnsweringStreaming ¶ added in v0.8.1
func WithDocumentQuestionAnsweringStreaming() DocumentQuestionAnsweringOption
type DocumentQuestionAnsweringOutput ¶ added in v0.8.1
type DocumentQuestionAnsweringOutput struct {
Results []DocumentQuestionAnsweringResult
}
func (*DocumentQuestionAnsweringOutput) GetOutput ¶ added in v0.8.2
func (o *DocumentQuestionAnsweringOutput) GetOutput() []any
type DocumentQuestionAnsweringPipeline ¶ added in v0.8.1
type DocumentQuestionAnsweringPipeline struct {
*backends.BasePipeline
Decoder *backends.Model
DecoderFilename string
MaxLength int
// contains filtered or unexported fields
}
DocumentQuestionAnsweringPipeline runs a Donut DocVQA encoder/decoder. It is not an ORT GenAI conversational pipeline.
func NewDocumentQuestionAnsweringPipeline ¶ added in v0.8.1
func NewDocumentQuestionAnsweringPipeline(ctx context.Context, config DocumentQuestionAnsweringConfig, model *backends.Model) (*DocumentQuestionAnsweringPipeline, error)
func (*DocumentQuestionAnsweringPipeline) GetMetadata ¶ added in v0.8.2
func (p *DocumentQuestionAnsweringPipeline) GetMetadata() backends.PipelineMetadata
func (*DocumentQuestionAnsweringPipeline) GetModel ¶ added in v0.8.2
func (p *DocumentQuestionAnsweringPipeline) GetModel() *backends.Model
func (*DocumentQuestionAnsweringPipeline) GetStatistics ¶ added in v0.8.2
func (p *DocumentQuestionAnsweringPipeline) GetStatistics() backends.PipelineStatistics
func (*DocumentQuestionAnsweringPipeline) IsGenerative ¶ added in v0.8.1
func (*DocumentQuestionAnsweringPipeline) IsGenerative() bool
func (*DocumentQuestionAnsweringPipeline) Run ¶ added in v0.8.1
func (p *DocumentQuestionAnsweringPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*DocumentQuestionAnsweringPipeline) RunPipeline ¶ added in v0.8.1
func (p *DocumentQuestionAnsweringPipeline) RunPipeline(ctx context.Context, inputs []DocumentQuestionAnsweringInput) (*DocumentQuestionAnsweringOutput, error)
func (*DocumentQuestionAnsweringPipeline) RunWithImages ¶ added in v0.8.1
func (p *DocumentQuestionAnsweringPipeline) RunWithImages(ctx context.Context, inputs []backends.ImageTextInput) (*DocumentQuestionAnsweringOutput, error)
func (*DocumentQuestionAnsweringPipeline) Validate ¶ added in v0.8.1
func (p *DocumentQuestionAnsweringPipeline) Validate() error
type DocumentQuestionAnsweringResult ¶ added in v0.8.2
type DocumentQuestionAnsweringResult struct{ Answer string }
type FFmpegVideoDecoder ¶ added in v0.8.4
FFmpegVideoDecoder is an optional file decoder. FFmpegPath and FFprobePath default to ffmpeg and ffprobe on PATH. No codec library is linked into Hugot.
func (FFmpegVideoDecoder) Decode ¶ added in v0.8.4
func (d FFmpegVideoDecoder) Decode(ctx context.Context, path string, maxFrames int) (VideoInput, error)
type FeatureExtractionOutput ¶
type FeatureExtractionOutput struct {
Embeddings [][]float32
}
func (*FeatureExtractionOutput) GetOutput ¶ added in v0.0.5
func (t *FeatureExtractionOutput) GetOutput() []any
type FeatureExtractionPipeline ¶
type FeatureExtractionPipeline struct {
*backends.BasePipeline
OutputName string
Output backends.InputOutputInfo
OutputIndex int // Record the index of the output selected, defaults to first (0)
Normalization bool
// contains filtered or unexported fields
}
FeatureExtractionPipeline A feature extraction pipeline is a go version of https://github.com/huggingface/transformers/blob/main/src/transformers/pipelines/feature_extraction.py It supports both text and image inputs for embedding extraction.
func NewFeatureExtractionPipeline ¶
func NewFeatureExtractionPipeline(sessionContext context.Context, config backends.PipelineConfig[*FeatureExtractionPipeline], model *backends.Model) (*FeatureExtractionPipeline, error)
NewFeatureExtractionPipeline init a feature extraction pipeline.
func (*FeatureExtractionPipeline) GetMetadata ¶ added in v0.1.4
func (p *FeatureExtractionPipeline) GetMetadata() backends.PipelineMetadata
GetMetadata returns metadata information about the pipeline, in particular: OutputInfo: names and dimensions of the output layer.
func (*FeatureExtractionPipeline) GetModel ¶ added in v0.3.0
func (p *FeatureExtractionPipeline) GetModel() *backends.Model
func (*FeatureExtractionPipeline) GetStatistics ¶ added in v0.5.9
func (p *FeatureExtractionPipeline) GetStatistics() backends.PipelineStatistics
GetStatistics returns the runtime statistics for the pipeline.
func (*FeatureExtractionPipeline) IsGenerative ¶ added in v0.6.0
func (p *FeatureExtractionPipeline) IsGenerative() bool
func (*FeatureExtractionPipeline) PreprocessImages ¶ added in v0.6.0
func (p *FeatureExtractionPipeline) PreprocessImages(batch *backends.PipelineBatch, inputs []image.Image) error
PreprocessImages converts images to input tensors for vision models.
func (*FeatureExtractionPipeline) Run ¶
func (p *FeatureExtractionPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
Run the pipeline on a batch of strings.
func (*FeatureExtractionPipeline) RunPipeline ¶ added in v0.0.6
func (p *FeatureExtractionPipeline) RunPipeline(ctx context.Context, inputs []string) (*FeatureExtractionOutput, error)
RunPipeline is like Run, but returns the concrete feature extraction output type rather than the interface.
func (*FeatureExtractionPipeline) RunRaw ¶ added in v0.8.2
func (p *FeatureExtractionPipeline) RunRaw(ctx context.Context, inputs []string) (*RawFeatureOutput, error)
RunRaw returns unpooled, unnormalized text features, including padding tokens.
func (*FeatureExtractionPipeline) RunRawWithImagePaths ¶ added in v0.8.2
func (p *FeatureExtractionPipeline) RunRawWithImagePaths(ctx context.Context, paths []string) (*RawFeatureOutput, error)
RunRawWithImagePaths loads images and returns their raw features.
func (*FeatureExtractionPipeline) RunRawWithImages ¶ added in v0.8.2
func (p *FeatureExtractionPipeline) RunRawWithImages(ctx context.Context, images []image.Image) (*RawFeatureOutput, error)
RunRawWithImages returns the selected image tensor without pooling or normalization.
func (*FeatureExtractionPipeline) RunWithImagePaths ¶ added in v0.6.0
func (p *FeatureExtractionPipeline) RunWithImagePaths(ctx context.Context, paths []string) (*FeatureExtractionOutput, error)
RunWithImagePaths loads images from file paths and runs the pipeline. Convenience method that combines image loading with RunWithImages.
func (*FeatureExtractionPipeline) RunWithImages ¶ added in v0.6.0
func (p *FeatureExtractionPipeline) RunWithImages(ctx context.Context, images []image.Image) (*FeatureExtractionOutput, error)
RunWithImages runs the pipeline on a batch of images (for vision models). Use this method when ImageMode is enabled.
func (*FeatureExtractionPipeline) Validate ¶ added in v0.0.5
func (p *FeatureExtractionPipeline) Validate() error
Validate checks that the pipeline is valid.
type FillMaskOutput ¶ added in v0.8.1
type FillMaskOutput struct {
Predictions [][]FillMaskResult
}
func (*FillMaskOutput) GetOutput ¶ added in v0.8.1
func (o *FillMaskOutput) GetOutput() []any
type FillMaskPipeline ¶ added in v0.8.1
type FillMaskPipeline struct {
*backends.BasePipeline
TopK int
MaskToken string
}
FillMaskPipeline predicts replacements for a single mask token in each input.
func NewFillMaskPipeline ¶ added in v0.8.1
func NewFillMaskPipeline(ctx context.Context, config backends.PipelineConfig[*FillMaskPipeline], model *backends.Model) (*FillMaskPipeline, error)
func (*FillMaskPipeline) GetMetadata ¶ added in v0.8.1
func (p *FillMaskPipeline) GetMetadata() backends.PipelineMetadata
func (*FillMaskPipeline) GetModel ¶ added in v0.8.1
func (p *FillMaskPipeline) GetModel() *backends.Model
func (*FillMaskPipeline) GetStatistics ¶ added in v0.8.1
func (p *FillMaskPipeline) GetStatistics() backends.PipelineStatistics
func (*FillMaskPipeline) IsGenerative ¶ added in v0.8.1
func (p *FillMaskPipeline) IsGenerative() bool
func (*FillMaskPipeline) Run ¶ added in v0.8.1
func (p *FillMaskPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*FillMaskPipeline) RunPipeline ¶ added in v0.8.1
func (p *FillMaskPipeline) RunPipeline(ctx context.Context, inputs []string) (*FillMaskOutput, error)
func (*FillMaskPipeline) Validate ¶ added in v0.8.1
func (p *FillMaskPipeline) Validate() error
type FillMaskResult ¶ added in v0.8.1
type GroundedObjectDetectionPipeline ¶ added in v0.8.3
type GroundedObjectDetectionPipeline struct {
*backends.BasePipeline
BoxThreshold float32
TextThreshold float32
}
GroundedObjectDetectionPipeline runs a caption-prompted detector such as Grounding DINO. One caption is encoded with the image. Labels come from the tokens whose class probability clears the text threshold.
func NewGroundedObjectDetectionPipeline ¶ added in v0.8.3
func NewGroundedObjectDetectionPipeline(ctx context.Context, config backends.PipelineConfig[*GroundedObjectDetectionPipeline], model *backends.Model) (*GroundedObjectDetectionPipeline, error)
func (*GroundedObjectDetectionPipeline) GetMetadata ¶ added in v0.8.3
func (p *GroundedObjectDetectionPipeline) GetMetadata() backends.PipelineMetadata
func (*GroundedObjectDetectionPipeline) GetModel ¶ added in v0.8.3
func (p *GroundedObjectDetectionPipeline) GetModel() *backends.Model
func (*GroundedObjectDetectionPipeline) GetStatistics ¶ added in v0.8.3
func (p *GroundedObjectDetectionPipeline) GetStatistics() backends.PipelineStatistics
func (*GroundedObjectDetectionPipeline) IsGenerative ¶ added in v0.8.3
func (*GroundedObjectDetectionPipeline) IsGenerative() bool
func (*GroundedObjectDetectionPipeline) Run ¶ added in v0.8.3
func (p *GroundedObjectDetectionPipeline) Run(context.Context, []string) (backends.PipelineBatchOutput, error)
Run is unavailable because []string cannot carry the caption. Use RunWithCaption.
func (*GroundedObjectDetectionPipeline) RunWithCaption ¶ added in v0.8.3
func (p *GroundedObjectDetectionPipeline) RunWithCaption(ctx context.Context, inputs []string, caption string) (*ObjectDetectionOutput, error)
func (*GroundedObjectDetectionPipeline) RunWithImagesAndCaption ¶ added in v0.8.3
func (p *GroundedObjectDetectionPipeline) RunWithImagesAndCaption(ctx context.Context, images []image.Image, caption string) (*ObjectDetectionOutput, error)
func (*GroundedObjectDetectionPipeline) Validate ¶ added in v0.8.3
func (p *GroundedObjectDetectionPipeline) Validate() error
type ImageClassificationOutput ¶ added in v0.5.0
type ImageClassificationOutput struct {
Predictions [][]ImageClassificationResult // batch of results
}
func (*ImageClassificationOutput) GetOutput ¶ added in v0.5.0
func (o *ImageClassificationOutput) GetOutput() []any
type ImageClassificationPipeline ¶ added in v0.5.0
type ImageClassificationPipeline struct {
*backends.BasePipeline
IDLabelMap map[int]string
Output backends.InputOutputInfo
TopK int
// contains filtered or unexported fields
}
ImageClassificationPipeline is a go version of https://github.com/huggingface/transformers/blob/main/src/transformers/pipelines/image_classification.py It takes images (as file paths or image.Image) and returns top-k class predictions.
func NewImageClassificationPipeline ¶ added in v0.5.0
func NewImageClassificationPipeline(sessionContext context.Context, config backends.PipelineConfig[*ImageClassificationPipeline], model *backends.Model) (*ImageClassificationPipeline, error)
NewImageClassificationPipeline initializes an image classification pipeline.
func (*ImageClassificationPipeline) GetMetadata ¶ added in v0.5.0
func (p *ImageClassificationPipeline) GetMetadata() backends.PipelineMetadata
func (*ImageClassificationPipeline) GetModel ¶ added in v0.5.0
func (p *ImageClassificationPipeline) GetModel() *backends.Model
func (*ImageClassificationPipeline) GetStatistics ¶ added in v0.5.9
func (p *ImageClassificationPipeline) GetStatistics() backends.PipelineStatistics
func (*ImageClassificationPipeline) IsGenerative ¶ added in v0.6.0
func (p *ImageClassificationPipeline) IsGenerative() bool
func (*ImageClassificationPipeline) Run ¶ added in v0.5.0
func (p *ImageClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
Run runs the pipeline on a batch of image file paths.
func (*ImageClassificationPipeline) RunPipeline ¶ added in v0.5.0
func (p *ImageClassificationPipeline) RunPipeline(ctx context.Context, inputs []string) (*ImageClassificationOutput, error)
RunPipeline returns the concrete output type.
func (*ImageClassificationPipeline) RunWithImages ¶ added in v0.5.0
func (p *ImageClassificationPipeline) RunWithImages(ctx context.Context, inputs []image.Image) (*ImageClassificationOutput, error)
func (*ImageClassificationPipeline) Validate ¶ added in v0.5.0
func (p *ImageClassificationPipeline) Validate() error
type ImageClassificationResult ¶ added in v0.5.0
type ImageFeatureExtractionOutput ¶ added in v0.8.1
type ImageFeatureExtractionOutput struct{ Embeddings [][]float32 }
func (*ImageFeatureExtractionOutput) GetOutput ¶ added in v0.8.1
func (o *ImageFeatureExtractionOutput) GetOutput() []any
type ImageFeatureExtractionPipeline ¶ added in v0.8.1
type ImageFeatureExtractionPipeline struct {
*backends.BasePipeline
OutputIndex int
Normalization bool
// contains filtered or unexported fields
}
ImageFeatureExtractionPipeline returns one pooled embedding per image.
func NewImageFeatureExtractionPipeline ¶ added in v0.8.1
func NewImageFeatureExtractionPipeline(ctx context.Context, config backends.PipelineConfig[*ImageFeatureExtractionPipeline], model *backends.Model) (*ImageFeatureExtractionPipeline, error)
func (*ImageFeatureExtractionPipeline) GetMetadata ¶ added in v0.8.1
func (p *ImageFeatureExtractionPipeline) GetMetadata() backends.PipelineMetadata
func (*ImageFeatureExtractionPipeline) GetModel ¶ added in v0.8.1
func (p *ImageFeatureExtractionPipeline) GetModel() *backends.Model
func (*ImageFeatureExtractionPipeline) GetStatistics ¶ added in v0.8.1
func (p *ImageFeatureExtractionPipeline) GetStatistics() backends.PipelineStatistics
func (*ImageFeatureExtractionPipeline) IsGenerative ¶ added in v0.8.1
func (p *ImageFeatureExtractionPipeline) IsGenerative() bool
func (*ImageFeatureExtractionPipeline) Run ¶ added in v0.8.1
func (p *ImageFeatureExtractionPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*ImageFeatureExtractionPipeline) RunPipeline ¶ added in v0.8.1
func (p *ImageFeatureExtractionPipeline) RunPipeline(ctx context.Context, inputs []string) (*ImageFeatureExtractionOutput, error)
func (*ImageFeatureExtractionPipeline) RunRaw ¶ added in v0.8.2
func (p *ImageFeatureExtractionPipeline) RunRaw(ctx context.Context, inputs []string) (*RawFeatureOutput, error)
RunRaw loads image paths and returns unpooled, unnormalized model features.
func (*ImageFeatureExtractionPipeline) RunRawWithImages ¶ added in v0.8.2
func (p *ImageFeatureExtractionPipeline) RunRawWithImages(ctx context.Context, images []image.Image) (*RawFeatureOutput, error)
RunRawWithImages retains the batch, sequence and hidden dimensions of image features.
func (*ImageFeatureExtractionPipeline) RunWithImages ¶ added in v0.8.1
func (p *ImageFeatureExtractionPipeline) RunWithImages(ctx context.Context, images []image.Image) (*ImageFeatureExtractionOutput, error)
func (*ImageFeatureExtractionPipeline) Validate ¶ added in v0.8.1
func (p *ImageFeatureExtractionPipeline) Validate() error
type ImagePair ¶ added in v0.8.4
ImagePair keeps pair boundaries explicit. Each side must supply exactly one decoded image or path. Images may have different original dimensions.
type ImageSegmentationOutput ¶ added in v0.8.1
type ImageSegmentationOutput struct {
Results []ImageSegmentationResult
}
func (*ImageSegmentationOutput) GetOutput ¶ added in v0.8.1
func (o *ImageSegmentationOutput) GetOutput() []any
type ImageSegmentationPipeline ¶ added in v0.8.1
type ImageSegmentationPipeline struct {
*backends.BasePipeline
IDLabelMap map[int]string
LogitsOutput string
ScoreThreshold float32
// contains filtered or unexported fields
}
ImageSegmentationPipeline decodes semantic segmentation logits into masks in the coordinate space of the source image.
func NewImageSegmentationPipeline ¶ added in v0.8.1
func NewImageSegmentationPipeline(ctx context.Context, config backends.PipelineConfig[*ImageSegmentationPipeline], model *backends.Model) (*ImageSegmentationPipeline, error)
func (*ImageSegmentationPipeline) GetMetadata ¶ added in v0.8.1
func (p *ImageSegmentationPipeline) GetMetadata() backends.PipelineMetadata
func (*ImageSegmentationPipeline) GetModel ¶ added in v0.8.1
func (p *ImageSegmentationPipeline) GetModel() *backends.Model
func (*ImageSegmentationPipeline) GetStatistics ¶ added in v0.8.1
func (p *ImageSegmentationPipeline) GetStatistics() backends.PipelineStatistics
func (*ImageSegmentationPipeline) IsGenerative ¶ added in v0.8.1
func (p *ImageSegmentationPipeline) IsGenerative() bool
func (*ImageSegmentationPipeline) Run ¶ added in v0.8.1
func (p *ImageSegmentationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*ImageSegmentationPipeline) RunPipeline ¶ added in v0.8.1
func (p *ImageSegmentationPipeline) RunPipeline(ctx context.Context, inputs []string) (*ImageSegmentationOutput, error)
func (*ImageSegmentationPipeline) RunWithImages ¶ added in v0.8.1
func (p *ImageSegmentationPipeline) RunWithImages(ctx context.Context, images []image.Image) (*ImageSegmentationOutput, error)
func (*ImageSegmentationPipeline) Validate ¶ added in v0.8.1
func (p *ImageSegmentationPipeline) Validate() error
type ImageSegmentationResult ¶ added in v0.8.1
type ImageSegmentationResult struct {
Width int
Height int
Segments []ImageSegmentationSegment
}
type ImageSegmentationSegment ¶ added in v0.8.1
type ImageTextPrompt ¶ added in v0.8.1
type ImageTextPrompt struct {
ImagePath string
Prompt string
Role string
History []backends.Message
}
ImageTextPrompt pairs an image file (or data URI) with a prompt.
By default (all zero values, as before) a prompt describes a single user turn: the pipeline sends one message with Role "user", the Prompt as its content, and ImagePath as the attached image. That keeps the one-shot image+text->text workflows backward compatible.
For multi-turn image/text conversations, set Role to the role the final (image) turn should carry, and add History for any previous turns in this conversation. They are emitted in order — History, then the final image turn — so the underlying backend sees a full, correctly labelled conversation. If a per-conversation system turn is needed, put it in History[0]; the pipeline-level SystemPrompt on the pipeline struct (set once at construction) is still applied globally by the backend.
type ImageTextToTextConfig ¶ added in v0.8.1
type ImageTextToTextConfig = backends.PipelineConfig[*ImageTextToTextPipeline]
type ImageTextToTextOption ¶ added in v0.8.1
type ImageTextToTextOption = backends.PipelineOption[*ImageTextToTextPipeline]
func WithImageTextToTextGuidance ¶ added in v0.8.4
func WithImageTextToTextGuidance(guidance *backends.Guidance) ImageTextToTextOption
WithImageTextToTextGuidance enables constrained text generation using a JSON schema, regex, or Lark grammar supported by the selected ORT GenAI session.
func WithImageTextToTextMaxLength ¶ added in v0.8.1
func WithImageTextToTextMaxLength(n int) ImageTextToTextOption
func WithImageTextToTextStreaming ¶ added in v0.8.1
func WithImageTextToTextStreaming() ImageTextToTextOption
func WithImageTextToTextTools ¶ added in v0.8.4
func WithImageTextToTextTools(tools []string) ImageTextToTextOption
WithImageTextToTextTools sets Hermes-style tool definitions for the chat template. The pipeline returns generated tool-call text; applications execute tools themselves.
type ImageTextToTextPipeline ¶ added in v0.8.1
type ImageTextToTextPipeline struct {
// contains filtered or unexported fields
}
func NewImageTextToTextPipeline ¶ added in v0.8.1
func NewImageTextToTextPipeline(ctx context.Context, config ImageTextToTextConfig, model *backends.Model) (*ImageTextToTextPipeline, error)
func (ImageTextToTextPipeline) GetMetadata ¶ added in v0.8.1
func (p ImageTextToTextPipeline) GetMetadata() backends.PipelineMetadata
func (ImageTextToTextPipeline) GetStatistics ¶ added in v0.8.1
func (p ImageTextToTextPipeline) GetStatistics() backends.PipelineStatistics
func (*ImageTextToTextPipeline) IsGenerative ¶ added in v0.8.1
func (*ImageTextToTextPipeline) IsGenerative() bool
func (*ImageTextToTextPipeline) Run ¶ added in v0.8.1
func (p *ImageTextToTextPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*ImageTextToTextPipeline) RunWithImages ¶ added in v0.8.1
func (p *ImageTextToTextPipeline) RunWithImages(ctx context.Context, inputs []ImageTextPrompt) (*MultimodalTextOutput, error)
type KeypointMatch ¶ added in v0.8.4
type KeypointMatchingConfig ¶ added in v0.8.4
type KeypointMatchingConfig = backends.PipelineConfig[*KeypointMatchingPipeline]
type KeypointMatchingOption ¶ added in v0.8.4
type KeypointMatchingOption = backends.PipelineOption[*KeypointMatchingPipeline]
func WithKeypointMatchingThreshold ¶ added in v0.8.4
func WithKeypointMatchingThreshold(threshold float32) KeypointMatchingOption
type KeypointMatchingOutput ¶ added in v0.8.4
type KeypointMatchingOutput struct{ Matches [][]KeypointMatch }
func (*KeypointMatchingOutput) GetOutput ¶ added in v0.8.4
func (o *KeypointMatchingOutput) GetOutput() []any
type KeypointMatchingPipeline ¶ added in v0.8.4
type KeypointMatchingPipeline struct {
*backends.BasePipeline
Threshold float32
// contains filtered or unexported fields
}
KeypointMatchingPipeline accepts the dense/padded FP32 SuperGlue export contract. Dynamic keypoint counts are read from runtime output shapes.
func NewKeypointMatchingPipeline ¶ added in v0.8.4
func NewKeypointMatchingPipeline(ctx context.Context, config KeypointMatchingConfig, model *backends.Model) (*KeypointMatchingPipeline, error)
func (*KeypointMatchingPipeline) GetMetadata ¶ added in v0.8.4
func (p *KeypointMatchingPipeline) GetMetadata() backends.PipelineMetadata
func (*KeypointMatchingPipeline) GetModel ¶ added in v0.8.4
func (p *KeypointMatchingPipeline) GetModel() *backends.Model
func (*KeypointMatchingPipeline) GetStatistics ¶ added in v0.8.4
func (p *KeypointMatchingPipeline) GetStatistics() backends.PipelineStatistics
func (*KeypointMatchingPipeline) IsGenerative ¶ added in v0.8.4
func (*KeypointMatchingPipeline) IsGenerative() bool
func (*KeypointMatchingPipeline) Run ¶ added in v0.8.4
func (p *KeypointMatchingPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
Run accepts one JSON ImagePair per string, e.g. {"paths":["a.png","b.png"]}.
func (*KeypointMatchingPipeline) RunPairs ¶ added in v0.8.4
func (p *KeypointMatchingPipeline) RunPairs(ctx context.Context, pairs []ImagePair) (*KeypointMatchingOutput, error)
func (*KeypointMatchingPipeline) Validate ¶ added in v0.8.4
func (p *KeypointMatchingPipeline) Validate() error
type MaskGenerationMask ¶ added in v0.8.1
type MaskGenerationOutput ¶ added in v0.8.1
type MaskGenerationOutput struct{ Results []MaskGenerationResult }
func (*MaskGenerationOutput) GetOutput ¶ added in v0.8.2
func (o *MaskGenerationOutput) GetOutput() []any
type MaskGenerationPipeline ¶ added in v0.8.1
type MaskGenerationPipeline struct {
*backends.BasePipeline
Decoder *backends.Model
DecoderFilename string
PointsPerSide, PointsPerBatch int
PredictedIOUThreshold, StabilityThreshold, StabilityOffset, NMSThreshold float32
// contains filtered or unexported fields
}
MaskGenerationPipeline generates automatic SAM proposals, not semantic classes.
func NewMaskGenerationPipeline ¶ added in v0.8.1
func NewMaskGenerationPipeline(ctx context.Context, config backends.PipelineConfig[*MaskGenerationPipeline], model *backends.Model) (*MaskGenerationPipeline, error)
func (*MaskGenerationPipeline) GetMetadata ¶ added in v0.8.2
func (p *MaskGenerationPipeline) GetMetadata() backends.PipelineMetadata
func (*MaskGenerationPipeline) GetModel ¶ added in v0.8.2
func (p *MaskGenerationPipeline) GetModel() *backends.Model
func (*MaskGenerationPipeline) GetStatistics ¶ added in v0.8.2
func (p *MaskGenerationPipeline) GetStatistics() backends.PipelineStatistics
func (*MaskGenerationPipeline) IsGenerative ¶ added in v0.8.1
func (*MaskGenerationPipeline) IsGenerative() bool
func (*MaskGenerationPipeline) Run ¶ added in v0.8.1
func (p *MaskGenerationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*MaskGenerationPipeline) RunPipeline ¶ added in v0.8.1
func (p *MaskGenerationPipeline) RunPipeline(ctx context.Context, inputs []string) (*MaskGenerationOutput, error)
func (*MaskGenerationPipeline) RunWithBoxes ¶ added in v0.8.3
func (p *MaskGenerationPipeline) RunWithBoxes(ctx context.Context, img image.Image, boxes [][4]float32) (*MaskGenerationOutput, error)
RunWithBoxes prompts one SAM2 image with source-pixel xyxy boxes. Every decoder mask is returned with its IoU. SlimSAM has no box input.
func (*MaskGenerationPipeline) RunWithImages ¶ added in v0.8.1
func (p *MaskGenerationPipeline) RunWithImages(ctx context.Context, images []image.Image) (*MaskGenerationOutput, error)
func (*MaskGenerationPipeline) RunWithPoints ¶ added in v0.8.3
func (p *MaskGenerationPipeline) RunWithPoints(ctx context.Context, img image.Image, points [][2]float32, labels []int64) (*MaskGenerationOutput, error)
RunWithPoints prompts one SAM2 image with one object. Labels are 1 for a foreground point and 0 for background. Points are source-pixel xy. Every decoder mask is returned with its IoU.
func (*MaskGenerationPipeline) Validate ¶ added in v0.8.2
func (p *MaskGenerationPipeline) Validate() error
type MaskGenerationResult ¶ added in v0.8.1
type MaskGenerationResult struct {
Width, Height int
Masks []MaskGenerationMask
}
type MultimodalContent ¶ added in v0.8.4
type MultimodalContent struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
URL string `json:"url,omitempty"`
Video *VideoInput `json:"-"`
}
MultimodalContent is one ordered text, image, audio or video item. Media URLs are paths (images also accept data URIs). Decoded videos use Video instead of URL. Phi-4 receives video as ordered images annotated with their timestamps.
type MultimodalMessage ¶ added in v0.8.4
type MultimodalMessage struct {
Role string `json:"role"`
Content []MultimodalContent `json:"content"`
}
type MultimodalTextOutput ¶ added in v0.8.1
type MultimodalTextOutput struct {
Responses []string
TokenStream chan backends.SequenceDelta
ErrorStream chan error
}
func (*MultimodalTextOutput) GetOutput ¶ added in v0.8.1
func (o *MultimodalTextOutput) GetOutput() []any
type ObjectDetectionOutput ¶ added in v0.6.0
type ObjectDetectionOutput struct {
Detections [][]Detection
}
func (*ObjectDetectionOutput) GetOutput ¶ added in v0.6.0
func (o *ObjectDetectionOutput) GetOutput() []any
type ObjectDetectionPipeline ¶ added in v0.6.0
type ObjectDetectionPipeline struct {
*backends.BasePipeline
IDLabelMap map[int]string
BoxesOutput string
ScoresOutput string
TopK int
ScoreThreshold float32
IouThreshold float32
// contains filtered or unexported fields
}
ObjectDetectionPipeline implements a Hugging Face-like object detection pipeline. It supports models that output bounding boxes and class scores.
func NewObjectDetectionPipeline ¶ added in v0.6.0
func NewObjectDetectionPipeline(sessionContext context.Context, config backends.PipelineConfig[*ObjectDetectionPipeline], model *backends.Model) (*ObjectDetectionPipeline, error)
NewObjectDetectionPipeline initializes an object detection pipeline.
func (*ObjectDetectionPipeline) GetMetadata ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) GetMetadata() backends.PipelineMetadata
func (*ObjectDetectionPipeline) GetModel ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) GetModel() *backends.Model
func (*ObjectDetectionPipeline) GetStatistics ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) GetStatistics() backends.PipelineStatistics
func (*ObjectDetectionPipeline) GetStats ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) GetStats() []string
func (*ObjectDetectionPipeline) IsGenerative ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) IsGenerative() bool
func (*ObjectDetectionPipeline) Run ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
Run with file paths.
func (*ObjectDetectionPipeline) RunPipeline ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) RunPipeline(ctx context.Context, inputs []string) (*ObjectDetectionOutput, error)
func (*ObjectDetectionPipeline) RunWithImages ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) RunWithImages(ctx context.Context, inputs []image.Image) (*ObjectDetectionOutput, error)
func (*ObjectDetectionPipeline) Validate ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) Validate() error
type RawFeatureOutput ¶ added in v0.8.2
type RawFeatureOutput struct {
OutputName string
Dimensions backends.Shape
HiddenStates [][][]float32
Embeddings [][]float32
}
RawFeatureOutput retains the selected model output without pooling or normalization. HiddenStates is [batch, sequence, hidden] for rank-three outputs; Embeddings is [batch, hidden] for rank-two outputs. Exactly one of these fields is populated. Dimensions contains the actual tensor shape, including padding tokens.
func (*RawFeatureOutput) GetOutput ¶ added in v0.8.2
func (o *RawFeatureOutput) GetOutput() []any
type StreamingASROptions ¶ added in v0.9.0
type StreamingASROptions = backends.StreamingASROptions
StreamingASROptions configures PCM chunk sizing, VAD, and language settings.
type TableQuestionAnsweringConfig ¶ added in v0.8.1
type TableQuestionAnsweringConfig = backends.PipelineConfig[*TableQuestionAnsweringPipeline]
type TableQuestionAnsweringInput ¶ added in v0.8.1
type TableQuestionAnsweringInput struct {
Table [][]string
Question string
Query string
Role string
History []backends.Message
}
TableQuestionAnsweringInput pairs a table (header first) with a question. Query is a fallback for an empty Question. Native TAPAS uses the table/query.
type TableQuestionAnsweringOption ¶ added in v0.8.1
type TableQuestionAnsweringOption = backends.PipelineOption[*TableQuestionAnsweringPipeline]
func WithTableQuestionAnsweringMaxLength ¶ added in v0.8.1
func WithTableQuestionAnsweringMaxLength(n int) TableQuestionAnsweringOption
func WithTableQuestionAnsweringStreaming ¶ added in v0.8.1
func WithTableQuestionAnsweringStreaming() TableQuestionAnsweringOption
type TableQuestionAnsweringOutput ¶ added in v0.8.1
type TableQuestionAnsweringOutput struct {
Results []TableQuestionAnsweringResult
}
func (*TableQuestionAnsweringOutput) GetOutput ¶ added in v0.8.2
func (o *TableQuestionAnsweringOutput) GetOutput() []any
type TableQuestionAnsweringPipeline ¶ added in v0.8.1
type TableQuestionAnsweringPipeline struct {
*backends.BasePipeline
MaxLength int
CellThreshold float32
// Embedding limits include the reserved zero row/column ID.
MaxRows int
MaxColumns int
// contains filtered or unexported fields
}
TableQuestionAnsweringPipeline runs TAPAS cell selection and aggregation.
func NewTableQuestionAnsweringPipeline ¶ added in v0.8.1
func NewTableQuestionAnsweringPipeline(ctx context.Context, config TableQuestionAnsweringConfig, model *backends.Model) (*TableQuestionAnsweringPipeline, error)
func (*TableQuestionAnsweringPipeline) GetMetadata ¶ added in v0.8.2
func (p *TableQuestionAnsweringPipeline) GetMetadata() backends.PipelineMetadata
func (*TableQuestionAnsweringPipeline) GetModel ¶ added in v0.8.2
func (p *TableQuestionAnsweringPipeline) GetModel() *backends.Model
func (*TableQuestionAnsweringPipeline) GetStatistics ¶ added in v0.8.2
func (p *TableQuestionAnsweringPipeline) GetStatistics() backends.PipelineStatistics
func (*TableQuestionAnsweringPipeline) IsGenerative ¶ added in v0.8.1
func (*TableQuestionAnsweringPipeline) IsGenerative() bool
func (*TableQuestionAnsweringPipeline) Run ¶ added in v0.8.1
func (p *TableQuestionAnsweringPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*TableQuestionAnsweringPipeline) RunPipeline ¶ added in v0.8.1
func (p *TableQuestionAnsweringPipeline) RunPipeline(ctx context.Context, inputs []TableQuestionAnsweringInput) (*TableQuestionAnsweringOutput, error)
func (*TableQuestionAnsweringPipeline) RunSequential ¶ added in v0.8.2
func (p *TableQuestionAnsweringPipeline) RunSequential(ctx context.Context, table [][]string, questions []string) (*TableQuestionAnsweringOutput, error)
RunSequential answers questions in order, using only the preceding answer's selected cells as TAPAS prev_labels. State is local to this call.
func (*TableQuestionAnsweringPipeline) Validate ¶ added in v0.8.1
func (p *TableQuestionAnsweringPipeline) Validate() error
type TableQuestionAnsweringResult ¶ added in v0.8.2
type TabularClassificationOutput ¶ added in v0.6.2
type TabularClassificationOutput struct {
PredictedClass string
Probabilities []ClassificationOutput
}
type TabularOutput ¶ added in v0.6.2
type TabularOutput struct {
ClassificationResults []TabularClassificationOutput
RegressionResults []float32
}
TabularOutput returns per-input results. - For classification: []TabularClassificationOutput - For regression: float32 for each input.
func (*TabularOutput) GetOutput ¶ added in v0.6.2
func (o *TabularOutput) GetOutput() []any
type TabularPipeline ¶ added in v0.6.2
type TabularPipeline struct {
*backends.BasePipeline
IDLabelMap map[int]string // optional mapping from class IDs to labels
AggregationFunctionName string // for classification: SOFTMAX or SIGMOID
ProblemType string // "classification" or "regression"
}
TabularPipeline supports classic ML models (e.g., decision trees, random forests) exported to ONNX that take numeric feature vectors and output either class logits or regression values.
func NewTabularPipeline ¶ added in v0.6.2
func NewTabularPipeline(sessionContext context.Context, config backends.PipelineConfig[*TabularPipeline], model *backends.Model) (*TabularPipeline, error)
NewTabularPipeline initializes the pipeline.
func (*TabularPipeline) GetMetadata ¶ added in v0.6.2
func (p *TabularPipeline) GetMetadata() backends.PipelineMetadata
func (*TabularPipeline) GetModel ¶ added in v0.6.2
func (p *TabularPipeline) GetModel() *backends.Model
func (*TabularPipeline) GetStatistics ¶ added in v0.6.2
func (p *TabularPipeline) GetStatistics() backends.PipelineStatistics
func (*TabularPipeline) IsGenerative ¶ added in v0.6.2
func (p *TabularPipeline) IsGenerative() bool
func (*TabularPipeline) Run ¶ added in v0.6.2
func (p *TabularPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
Run executes the pipeline over inputs.
func (*TabularPipeline) RunPipeline ¶ added in v0.6.2
func (p *TabularPipeline) RunPipeline(ctx context.Context, inputs [][]float32) (*TabularOutput, error)
func (*TabularPipeline) Validate ¶ added in v0.6.2
func (p *TabularPipeline) Validate() error
type TextClassificationOutput ¶
type TextClassificationOutput struct {
ClassificationOutputs [][]ClassificationOutput
}
func (*TextClassificationOutput) GetOutput ¶ added in v0.0.5
func (t *TextClassificationOutput) GetOutput() []any
type TextClassificationPipeline ¶
type TextClassificationPipeline struct {
*backends.BasePipeline
AggregationFunctionName string
ProblemType string
FixedPaddingLength int
}
func NewTextClassificationPipeline ¶
func NewTextClassificationPipeline(sessionContext context.Context, config backends.PipelineConfig[*TextClassificationPipeline], model *backends.Model) (*TextClassificationPipeline, error)
NewTextClassificationPipeline initializes a new text classification pipeline.
func (*TextClassificationPipeline) GetMetadata ¶ added in v0.1.4
func (p *TextClassificationPipeline) GetMetadata() backends.PipelineMetadata
GetMetadata returns metadata information about the pipeline, in particular: OutputInfo: names and dimensions of the output layer used for text classification.
func (*TextClassificationPipeline) GetModel ¶ added in v0.3.0
func (p *TextClassificationPipeline) GetModel() *backends.Model
func (*TextClassificationPipeline) GetStatistics ¶ added in v0.5.9
func (p *TextClassificationPipeline) GetStatistics() backends.PipelineStatistics
GetStatistics returns the runtime statistics for the pipeline.
func (*TextClassificationPipeline) IsGenerative ¶ added in v0.6.0
func (p *TextClassificationPipeline) IsGenerative() bool
func (*TextClassificationPipeline) Run ¶
func (p *TextClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
Run the pipeline on a string batch.
func (*TextClassificationPipeline) RunPipeline ¶ added in v0.0.6
func (p *TextClassificationPipeline) RunPipeline(ctx context.Context, inputs []string) (*TextClassificationOutput, error)
func (*TextClassificationPipeline) Validate ¶ added in v0.0.5
func (p *TextClassificationPipeline) Validate() error
Validate checks that the pipeline is valid.
type TextGenerationCallOptions ¶ added in v0.8.6
type TextGenerationCallOptions struct {
// MaxLength overrides the pipeline's configured maximum when greater than zero.
// A zero value uses the pipeline maximum.
MaxLength int
}
TextGenerationCallOptions contains settings that can be changed for a single call.
type TextGenerationOutput ¶ added in v0.5.0
type TextGenerationOutput struct {
TokenStream chan backends.SequenceDelta
ErrorStream chan error
Responses []string
}
func (*TextGenerationOutput) GetOutput ¶ added in v0.5.0
func (t *TextGenerationOutput) GetOutput() []any
type TextGenerationPipeline ¶ added in v0.5.0
type TextGenerationPipeline struct {
*backends.BasePipeline
Temperature *float64
TopP *float64
Seed *int
Guidance *backends.Guidance
SystemPrompt string
StopSequences []string
Tools []string
MaxLength int
Streaming bool
}
func NewTextGenerationPipeline ¶ added in v0.5.0
func NewTextGenerationPipeline(sessionContext context.Context, config backends.PipelineConfig[*TextGenerationPipeline], model *backends.Model) (*TextGenerationPipeline, error)
NewTextGenerationPipeline initializes a new text generation pipeline.
func (*TextGenerationPipeline) GetContextLength ¶ added in v0.8.4
func (p *TextGenerationPipeline) GetContextLength() int
GetContextLength returns the model's configured context length.
func (*TextGenerationPipeline) GetMetadata ¶ added in v0.5.0
func (p *TextGenerationPipeline) GetMetadata() backends.PipelineMetadata
func (*TextGenerationPipeline) GetModel ¶ added in v0.5.0
func (p *TextGenerationPipeline) GetModel() *backends.Model
func (*TextGenerationPipeline) GetStatistics ¶ added in v0.5.9
func (p *TextGenerationPipeline) GetStatistics() backends.PipelineStatistics
GetStatistics returns the runtime statistics for the pipeline.
func (*TextGenerationPipeline) IsGenerative ¶ added in v0.6.0
func (p *TextGenerationPipeline) IsGenerative() bool
func (*TextGenerationPipeline) Run ¶ added in v0.5.0
func (p *TextGenerationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*TextGenerationPipeline) RunMessages ¶ added in v0.6.0
func (p *TextGenerationPipeline) RunMessages(ctx context.Context, inputs [][]backends.Message) (*TextGenerationOutput, error)
func (*TextGenerationPipeline) RunMessagesWithOptions ¶ added in v0.8.6
func (p *TextGenerationPipeline) RunMessagesWithOptions(ctx context.Context, inputs [][]backends.Message, options *TextGenerationCallOptions) (*TextGenerationOutput, error)
RunMessagesWithOptions runs message conversations with optional per-call overrides.
func (*TextGenerationPipeline) RunMessagesWithOverrides ¶ added in v0.7.0
func (p *TextGenerationPipeline) RunMessagesWithOverrides(ctx context.Context, inputs [][]backends.Message, tools []string, guidance *backends.Guidance) (*TextGenerationOutput, error)
func (*TextGenerationPipeline) RunPipeline ¶ added in v0.5.0
func (p *TextGenerationPipeline) RunPipeline(ctx context.Context, inputs []string) (*TextGenerationOutput, error)
func (*TextGenerationPipeline) RunPipelineWithOptions ¶ added in v0.8.6
func (p *TextGenerationPipeline) RunPipelineWithOptions(ctx context.Context, inputs []string, options *TextGenerationCallOptions) (*TextGenerationOutput, error)
RunPipelineWithOptions runs text prompts with optional per-call overrides.
func (*TextGenerationPipeline) RunWithOptions ¶ added in v0.8.6
func (p *TextGenerationPipeline) RunWithOptions(ctx context.Context, inputs []string, options *TextGenerationCallOptions) (backends.PipelineBatchOutput, error)
RunWithOptions runs text prompts and returns the standard pipeline output with optional per-call overrides.
func (*TextGenerationPipeline) Validate ¶ added in v0.5.0
func (p *TextGenerationPipeline) Validate() error
type TextToAudioConfig ¶ added in v0.8.1
type TextToAudioConfig = backends.PipelineConfig[*TextToAudioPipeline]
TextToAudioConfig configures a TextToAudioPipeline.
type TextToAudioOption ¶ added in v0.8.1
type TextToAudioOption = backends.PipelineOption[*TextToAudioPipeline]
TextToAudioOption configures a TextToAudioPipeline.
func WithTextToAudioSampleRate ¶ added in v0.8.1
func WithTextToAudioSampleRate(sampleRate int) TextToAudioOption
WithTextToAudioSampleRate sets the sample rate attached to generated waveforms.
type TextToAudioOutput ¶ added in v0.8.1
type TextToAudioOutput struct {
Audio []AudioWaveform
}
TextToAudioOutput contains one mono waveform for every input text.
func (*TextToAudioOutput) GetOutput ¶ added in v0.8.1
func (o *TextToAudioOutput) GetOutput() []any
type TextToAudioPipeline ¶ added in v0.8.1
type TextToAudioPipeline struct {
*backends.BasePipeline
Input backends.InputOutputInfo
Output backends.InputOutputInfo
SampleRate int
}
TextToAudioPipeline generates audio waveforms from text inputs.
func NewTextToAudioPipeline ¶ added in v0.8.1
func NewTextToAudioPipeline(ctx context.Context, config TextToAudioConfig, model *backends.Model) (*TextToAudioPipeline, error)
func (*TextToAudioPipeline) GetMetadata ¶ added in v0.8.1
func (p *TextToAudioPipeline) GetMetadata() backends.PipelineMetadata
func (*TextToAudioPipeline) GetModel ¶ added in v0.8.1
func (p *TextToAudioPipeline) GetModel() *backends.Model
func (*TextToAudioPipeline) GetStatistics ¶ added in v0.8.1
func (p *TextToAudioPipeline) GetStatistics() backends.PipelineStatistics
func (*TextToAudioPipeline) IsGenerative ¶ added in v0.8.1
func (p *TextToAudioPipeline) IsGenerative() bool
func (*TextToAudioPipeline) Run ¶ added in v0.8.1
func (p *TextToAudioPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
Run executes the pipeline for a batch of text inputs.
func (*TextToAudioPipeline) RunText ¶ added in v0.8.1
func (p *TextToAudioPipeline) RunText(ctx context.Context, inputs []string) (*TextToAudioOutput, error)
RunText generates waveforms from text inputs.
func (*TextToAudioPipeline) Validate ¶ added in v0.8.1
func (p *TextToAudioPipeline) Validate() error
type TextToSpeechConfig ¶ added in v0.8.1
type TextToSpeechConfig = TextToAudioConfig
type TextToSpeechOption ¶ added in v0.8.1
type TextToSpeechOption = TextToAudioOption
func WithTextToSpeechSampleRate ¶ added in v0.8.1
func WithTextToSpeechSampleRate(sampleRate int) TextToSpeechOption
type TextToSpeechOutput ¶ added in v0.8.1
type TextToSpeechOutput = TextToAudioOutput
TextToSpeechOutput is an alias for TextToAudioOutput.
type TextToSpeechPipeline ¶ added in v0.8.1
type TextToSpeechPipeline = TextToAudioPipeline
TextToSpeechPipeline is the supported text-to-speech alias for text-to-audio.
func NewTextToSpeechPipeline ¶ added in v0.8.1
func NewTextToSpeechPipeline(ctx context.Context, config TextToSpeechConfig, model *backends.Model) (*TextToSpeechPipeline, error)
type TokenClassificationOutput ¶
type TokenClassificationOutput struct {
Entities [][]Entity
}
func (*TokenClassificationOutput) GetOutput ¶ added in v0.0.5
func (t *TokenClassificationOutput) GetOutput() []any
type TokenClassificationPipeline ¶
type TokenClassificationPipeline struct {
*backends.BasePipeline
IDLabelMap map[int]string
AggregationStrategy string
UnknownToken string
IgnoreLabels []string
SplitWords bool
// WordSplitter, when set, splits each Run input into the words the model labels. See
// [WithWordSplitter].
WordSplitter WordSplitter
}
TokenClassificationPipeline is a go version of huggingface tokenClassificationPipeline. https://github.com/huggingface/transformers/blob/main/src/transformers/pipelines/token_classification.py
func NewTokenClassificationPipeline ¶
func NewTokenClassificationPipeline(sessionContext context.Context, config backends.PipelineConfig[*TokenClassificationPipeline], model *backends.Model) (*TokenClassificationPipeline, error)
NewTokenClassificationPipeline Initializes a feature extraction pipeline.
func (*TokenClassificationPipeline) GetMetadata ¶ added in v0.1.4
func (p *TokenClassificationPipeline) GetMetadata() backends.PipelineMetadata
GetMetadata returns metadata information about the pipeline, in particular: OutputInfo: names and dimensions of the output layer used for token classification.
func (*TokenClassificationPipeline) GetModel ¶ added in v0.3.0
func (p *TokenClassificationPipeline) GetModel() *backends.Model
func (*TokenClassificationPipeline) GetStatistics ¶ added in v0.5.9
func (p *TokenClassificationPipeline) GetStatistics() backends.PipelineStatistics
GetStatistics returns the runtime statistics for the pipeline.
func (*TokenClassificationPipeline) IsGenerative ¶ added in v0.6.0
func (p *TokenClassificationPipeline) IsGenerative() bool
func (*TokenClassificationPipeline) Run ¶
func (p *TokenClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
Run the pipeline on a string batch.
func (*TokenClassificationPipeline) RunPipeline ¶ added in v0.0.6
func (p *TokenClassificationPipeline) RunPipeline(ctx context.Context, inputs []string) (*TokenClassificationOutput, error)
RunPipeline is like Run but returns the concrete type rather than the interface.
func (*TokenClassificationPipeline) RunWords ¶ added in v0.5.9
func (p *TokenClassificationPipeline) RunWords(ctx context.Context, inputs [][]string) (*TokenClassificationOutput, error)
RunWords runs the pipeline for pre-split word inputs. Each input is a slice of words representing a pretokenized sentence. This is particularly useful when the user wants to control tokenization because of special tokens, hashtags, or other domain-specific tokenization needs.
func (*TokenClassificationPipeline) SplitText ¶ added in v0.8.4
func (p *TokenClassificationPipeline) SplitText(text string) ([]string, error)
SplitText splits text into words with the pipeline's word splitter.
func (*TokenClassificationPipeline) Validate ¶ added in v0.0.5
func (p *TokenClassificationPipeline) Validate() error
Validate checks that the pipeline is valid.
type VideoClassificationConfig ¶ added in v0.8.4
type VideoClassificationConfig = backends.PipelineConfig[*VideoClassificationPipeline]
type VideoClassificationOption ¶ added in v0.8.4
type VideoClassificationOption = backends.PipelineOption[*VideoClassificationPipeline]
func WithVideoClassificationFunction ¶ added in v0.8.4
func WithVideoClassificationFunction(function string) VideoClassificationOption
func WithVideoClassificationTopK ¶ added in v0.8.4
func WithVideoClassificationTopK(k int) VideoClassificationOption
func WithVideoDecoder ¶ added in v0.8.4
func WithVideoDecoder(decoder VideoDecoder) VideoClassificationOption
func WithVideoSampling ¶ added in v0.8.4
func WithVideoSampling(numFrames, rate int) VideoClassificationOption
func WithVideoTensorLayout ¶ added in v0.8.4
func WithVideoTensorLayout(layout string) VideoClassificationOption
WithVideoTensorLayout explicitly selects BTCHW (VideoMAE) or BCTHW.
type VideoClassificationOutput ¶ added in v0.8.4
type VideoClassificationOutput = ImageClassificationOutput
type VideoClassificationPipeline ¶ added in v0.8.4
type VideoClassificationPipeline struct {
*backends.BasePipeline
NumFrames int
FrameSamplingRate int
TopK int
FunctionToApply string
Layout string
Decoder VideoDecoder
// contains filtered or unexported fields
}
func NewVideoClassificationPipeline ¶ added in v0.8.4
func NewVideoClassificationPipeline(ctx context.Context, config VideoClassificationConfig, model *backends.Model) (*VideoClassificationPipeline, error)
func (*VideoClassificationPipeline) GetMetadata ¶ added in v0.8.4
func (p *VideoClassificationPipeline) GetMetadata() backends.PipelineMetadata
func (*VideoClassificationPipeline) GetModel ¶ added in v0.8.4
func (p *VideoClassificationPipeline) GetModel() *backends.Model
func (*VideoClassificationPipeline) GetStatistics ¶ added in v0.8.4
func (p *VideoClassificationPipeline) GetStatistics() backends.PipelineStatistics
func (*VideoClassificationPipeline) IsGenerative ¶ added in v0.8.4
func (*VideoClassificationPipeline) IsGenerative() bool
func (*VideoClassificationPipeline) Run ¶ added in v0.8.4
func (p *VideoClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*VideoClassificationPipeline) RunFiles ¶ added in v0.8.4
func (p *VideoClassificationPipeline) RunFiles(ctx context.Context, paths []string) (*VideoClassificationOutput, error)
func (*VideoClassificationPipeline) RunFrames ¶ added in v0.8.4
func (p *VideoClassificationPipeline) RunFrames(ctx context.Context, inputs []VideoInput) (*VideoClassificationOutput, error)
RunFrames processes videos individually so each graph call has batch size one.
func (*VideoClassificationPipeline) Validate ¶ added in v0.8.4
func (p *VideoClassificationPipeline) Validate() error
type VideoDecoder ¶ added in v0.8.4
VideoDecoder decodes at most maxFrames frames from the start of a video. Implementations must honor cancellation and return frames in presentation order.
type VideoInput ¶ added in v0.8.4
VideoInput contains decoded frames in presentation order. Timestamps, when present, must have one entry per frame. Sampling uses frame indices, as in the v5.20.2 VideoMAE image-processor path, even for variable frame rates.
type WordSplitter ¶ added in v0.8.4
WordSplitter splits a raw input into the words a token classification model labels, one tag per word. Models fine-tuned on custom word boundaries (for example "Row7" split into "Row" and "7") need the same split at inference, or the model sees inputs it was not trained on and labels words that do not line up with the training tags.
type ZeroShotAudioClassificationConfig ¶ added in v0.8.1
type ZeroShotAudioClassificationConfig = backends.PipelineConfig[*ZeroShotAudioClassificationPipeline]
ZeroShotAudioClassificationConfig configures a zero-shot audio pipeline.
type ZeroShotAudioClassificationOption ¶ added in v0.8.1
type ZeroShotAudioClassificationOption = backends.PipelineOption[*ZeroShotAudioClassificationPipeline]
ZeroShotAudioClassificationConfig configures a zero-shot audio pipeline.
func WithAudioLabels ¶ added in v0.8.1
func WithAudioLabels(labels []string) ZeroShotAudioClassificationOption
func WithZeroShotAudioHypothesisTemplate ¶ added in v0.8.2
func WithZeroShotAudioHypothesisTemplate(template string) ZeroShotAudioClassificationOption
WithZeroShotAudioHypothesisTemplate sets the text template used to describe each candidate label.
func WithZeroShotAudioLabels ¶ added in v0.8.1
func WithZeroShotAudioLabels(labels []string) ZeroShotAudioClassificationOption
WithZeroShotAudioLabels is the family-specific spelling of WithAudioLabels.
func WithZeroShotAudioSampleRate ¶ added in v0.8.1
func WithZeroShotAudioSampleRate(sampleRate int) ZeroShotAudioClassificationOption
WithZeroShotAudioSampleRate sets the sample rate expected by the model.
func WithZeroShotAudioTopK ¶ added in v0.8.1
func WithZeroShotAudioTopK(k int) ZeroShotAudioClassificationOption
type ZeroShotAudioClassificationOutput ¶ added in v0.8.1
type ZeroShotAudioClassificationOutput struct {
Predictions [][]ZeroShotAudioClassificationResult
}
func (*ZeroShotAudioClassificationOutput) GetOutput ¶ added in v0.8.1
func (o *ZeroShotAudioClassificationOutput) GetOutput() []any
type ZeroShotAudioClassificationPipeline ¶ added in v0.8.1
type ZeroShotAudioClassificationPipeline struct {
*backends.BasePipeline
Labels []string
TopK int
Input backends.InputOutputInfo
SampleRate int
HypothesisTemplate string
}
ZeroShotAudioClassificationPipeline scores candidate labels against audio. The model compares an audio input with tokenized candidate text and returns pairwise similarities.
func NewZeroShotAudioClassificationPipeline ¶ added in v0.8.1
func NewZeroShotAudioClassificationPipeline(ctx context.Context, config ZeroShotAudioClassificationConfig, model *backends.Model) (*ZeroShotAudioClassificationPipeline, error)
func (*ZeroShotAudioClassificationPipeline) GetMetadata ¶ added in v0.8.1
func (p *ZeroShotAudioClassificationPipeline) GetMetadata() backends.PipelineMetadata
func (*ZeroShotAudioClassificationPipeline) GetModel ¶ added in v0.8.1
func (p *ZeroShotAudioClassificationPipeline) GetModel() *backends.Model
func (*ZeroShotAudioClassificationPipeline) GetStatistics ¶ added in v0.8.1
func (p *ZeroShotAudioClassificationPipeline) GetStatistics() backends.PipelineStatistics
func (*ZeroShotAudioClassificationPipeline) IsGenerative ¶ added in v0.8.1
func (p *ZeroShotAudioClassificationPipeline) IsGenerative() bool
func (*ZeroShotAudioClassificationPipeline) Run ¶ added in v0.8.1
func (p *ZeroShotAudioClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*ZeroShotAudioClassificationPipeline) RunFiles ¶ added in v0.8.1
func (p *ZeroShotAudioClassificationPipeline) RunFiles(ctx context.Context, paths []string) (*ZeroShotAudioClassificationOutput, error)
func (*ZeroShotAudioClassificationPipeline) RunWaveforms ¶ added in v0.8.1
func (p *ZeroShotAudioClassificationPipeline) RunWaveforms(ctx context.Context, inputs []AudioWaveform) (*ZeroShotAudioClassificationOutput, error)
func (*ZeroShotAudioClassificationPipeline) RunWithAudio ¶ added in v0.8.1
func (p *ZeroShotAudioClassificationPipeline) RunWithAudio(ctx context.Context, inputs [][]float32) (*ZeroShotAudioClassificationOutput, error)
RunWithAudio executes mono samples already sampled at the pipeline's configured SampleRate.
func (*ZeroShotAudioClassificationPipeline) Validate ¶ added in v0.8.1
func (p *ZeroShotAudioClassificationPipeline) Validate() error
type ZeroShotAudioClassificationResult ¶ added in v0.8.1
ZeroShotAudioClassificationResult is the score for one candidate label.
type ZeroShotClassificationOutput ¶ added in v0.1.4
type ZeroShotClassificationPipeline ¶ added in v0.1.4
type ZeroShotClassificationPipeline struct {
*backends.BasePipeline
HypothesisTemplate string
Sequences []string
Labels []string
EntailmentID int
Multilabel bool
}
func NewZeroShotClassificationPipeline ¶ added in v0.1.4
func NewZeroShotClassificationPipeline(sessionContext context.Context, config backends.PipelineConfig[*ZeroShotClassificationPipeline], model *backends.Model) (*ZeroShotClassificationPipeline, error)
NewZeroShotClassificationPipeline create new Zero Shot Classification Pipeline.
func (*ZeroShotClassificationPipeline) GetMetadata ¶ added in v0.1.4
func (p *ZeroShotClassificationPipeline) GetMetadata() backends.PipelineMetadata
func (*ZeroShotClassificationPipeline) GetModel ¶ added in v0.3.0
func (p *ZeroShotClassificationPipeline) GetModel() *backends.Model
func (*ZeroShotClassificationPipeline) GetStatistics ¶ added in v0.5.9
func (p *ZeroShotClassificationPipeline) GetStatistics() backends.PipelineStatistics
GetStatistics returns the runtime statistics for the pipeline.
func (*ZeroShotClassificationPipeline) IsGenerative ¶ added in v0.6.0
func (p *ZeroShotClassificationPipeline) IsGenerative() bool
func (*ZeroShotClassificationPipeline) Run ¶ added in v0.1.4
func (p *ZeroShotClassificationPipeline) Run(ctx context.Context, inputs []string) (backends.PipelineBatchOutput, error)
func (*ZeroShotClassificationPipeline) RunPipeline ¶ added in v0.1.4
func (p *ZeroShotClassificationPipeline) RunPipeline(ctx context.Context, inputs []string) (*ZeroShotOutput, error)
func (*ZeroShotClassificationPipeline) RunSingle ¶ added in v0.7.8
func (p *ZeroShotClassificationPipeline) RunSingle(ctx context.Context, input string) (*ZeroShotOutput, error)
RunSingle runs zero-shot classification for one sequence.
func (*ZeroShotClassificationPipeline) Validate ¶ added in v0.1.4
func (p *ZeroShotClassificationPipeline) Validate() error
type ZeroShotImageClassificationOutput ¶ added in v0.8.1
type ZeroShotImageClassificationOutput struct {
Predictions [][]ZeroShotImageClassificationResult
}
func (*ZeroShotImageClassificationOutput) GetOutput ¶ added in v0.8.1
func (o *ZeroShotImageClassificationOutput) GetOutput() []any
type ZeroShotImageClassificationPipeline ¶ added in v0.8.1
type ZeroShotImageClassificationPipeline struct {
*backends.BasePipeline
Labels []string
TopK int
// contains filtered or unexported fields
}
func NewZeroShotImageClassificationPipeline ¶ added in v0.8.1
func NewZeroShotImageClassificationPipeline(ctx context.Context, config backends.PipelineConfig[*ZeroShotImageClassificationPipeline], model *backends.Model) (*ZeroShotImageClassificationPipeline, error)
func (*ZeroShotImageClassificationPipeline) GetMetadata ¶ added in v0.8.1
func (p *ZeroShotImageClassificationPipeline) GetMetadata() backends.PipelineMetadata
func (*ZeroShotImageClassificationPipeline) GetModel ¶ added in v0.8.1
func (p *ZeroShotImageClassificationPipeline) GetModel() *backends.Model
func (*ZeroShotImageClassificationPipeline) GetStatistics ¶ added in v0.8.1
func (p *ZeroShotImageClassificationPipeline) GetStatistics() backends.PipelineStatistics
func (*ZeroShotImageClassificationPipeline) IsGenerative ¶ added in v0.8.1
func (p *ZeroShotImageClassificationPipeline) IsGenerative() bool
func (*ZeroShotImageClassificationPipeline) Run ¶ added in v0.8.1
func (p *ZeroShotImageClassificationPipeline) Run(context.Context, []string) (backends.PipelineBatchOutput, error)
Run is intentionally unavailable because []string cannot express paired image/text inputs.
func (*ZeroShotImageClassificationPipeline) RunWithImageText ¶ added in v0.8.1
func (p *ZeroShotImageClassificationPipeline) RunWithImageText(ctx context.Context, inputs []backends.ImageTextInput) (*ZeroShotImageClassificationOutput, error)
func (*ZeroShotImageClassificationPipeline) RunWithImagesAndLabels ¶ added in v0.8.1
func (p *ZeroShotImageClassificationPipeline) RunWithImagesAndLabels(ctx context.Context, images []image.Image, labels []string) (*ZeroShotImageClassificationOutput, error)
func (*ZeroShotImageClassificationPipeline) Validate ¶ added in v0.8.1
func (p *ZeroShotImageClassificationPipeline) Validate() error
type ZeroShotImageClassificationResult ¶ added in v0.8.1
type ZeroShotObjectDetectionOutput ¶ added in v0.8.1
type ZeroShotObjectDetectionOutput = ObjectDetectionOutput
type ZeroShotObjectDetectionPipeline ¶ added in v0.8.1
type ZeroShotObjectDetectionPipeline struct {
*ObjectDetectionPipeline
Labels []string
}
ZeroShotObjectDetectionPipeline describes object detection models whose categories are supplied at runtime. Models must expose an image/text contract; the regular object detector is used when labels are provided by the model's ID-to-label map.
func NewZeroShotObjectDetectionPipeline ¶ added in v0.8.1
func NewZeroShotObjectDetectionPipeline(ctx context.Context, config backends.PipelineConfig[*ZeroShotObjectDetectionPipeline], model *backends.Model) (*ZeroShotObjectDetectionPipeline, error)
func (*ZeroShotObjectDetectionPipeline) IsGenerative ¶ added in v0.8.1
func (p *ZeroShotObjectDetectionPipeline) IsGenerative() bool
func (*ZeroShotObjectDetectionPipeline) Run ¶ added in v0.8.1
func (p *ZeroShotObjectDetectionPipeline) Run(context.Context, []string) (backends.PipelineBatchOutput, error)
Run is unavailable because []string cannot carry candidate labels. Use RunWithLabels for a request-specific label set.
func (*ZeroShotObjectDetectionPipeline) RunWithImagesAndLabels ¶ added in v0.8.1
func (p *ZeroShotObjectDetectionPipeline) RunWithImagesAndLabels(ctx context.Context, inputs []image.Image, labels []string) (*ZeroShotObjectDetectionOutput, error)
func (*ZeroShotObjectDetectionPipeline) RunWithLabels ¶ added in v0.8.1
func (p *ZeroShotObjectDetectionPipeline) RunWithLabels(ctx context.Context, inputs []string, labels []string) (*ZeroShotObjectDetectionOutput, error)
RunWithLabels validates the paired request. A backend with an explicit image/text tensor contract can implement the model-specific execution; current generic image execution cannot encode candidate labels safely.
func (*ZeroShotObjectDetectionPipeline) Validate ¶ added in v0.8.1
func (p *ZeroShotObjectDetectionPipeline) Validate() error
type ZeroShotOutput ¶ added in v0.1.4
type ZeroShotOutput struct {
ClassificationOutputs []ZeroShotClassificationOutput
}
func (*ZeroShotOutput) GetOutput ¶ added in v0.1.4
func (t *ZeroShotOutput) GetOutput() []any
GetOutput converts raw output to readable output.
Source Files
¶
- addressParse.go
- anyToAny.go
- anyToAnyContent.go
- anyToAnyJanus.go
- anyToAnyLFM.go
- anyToAnyNative.go
- audioClassification.go
- audioInput.go
- automaticSpeechRecognition.go
- backgroundRemoval.go
- clapAudioFeatures.go
- classification.go
- crossEncoder.go
- decision.go
- depthEstimation.go
- documentQuestionAnswering.go
- documentTableInputs.go
- featureExtraction.go
- fillMask.go
- groundedObjectDetection.go
- imageClassification.go
- imageFeatureExtraction.go
- imageOptions.go
- imageSegmentation.go
- keypointMatching.go
- maskGeneration.go
- multimodalGeneration.go
- nativeInference.go
- objectDetection.go
- rawFeatures.go
- tableQuestionAnswering.go
- tabular.go
- tensorContracts.go
- textClassification.go
- textGeneration.go
- textToAudio.go
- tokenClassification.go
- videoClassification.go
- videoDecoder.go
- visionProcessor.go
- zeroShotAudioClassification.go
- zeroShotClassification.go
- zeroShotImageClassification.go
- zeroShotObjectDetection.go