Documentation
¶
Index ¶
- func WithAverageAggregation() backends.PipelineOption[*TokenClassificationPipeline]
- func WithBatchSize(size int) backends.PipelineOption[*CrossEncoderPipeline]
- func WithBoxesOutput(name string) backends.PipelineOption[*ObjectDetectionPipeline]
- func WithClassification() backends.PipelineOption[*TabularPipeline]
- func WithDetectionIouThreshold(th float32) backends.PipelineOption[*ObjectDetectionPipeline]
- func WithDetectionScoreThreshold(th float32) backends.PipelineOption[*ObjectDetectionPipeline]
- func WithDetectionTopK(k int) backends.PipelineOption[*ObjectDetectionPipeline]
- func WithFirstAggregation() backends.PipelineOption[*TokenClassificationPipeline]
- func WithFixedPadding(fixedPaddingLength int) backends.PipelineOption[*TextClassificationPipeline]
- func WithHypothesisTemplate(hypothesisTemplate string) backends.PipelineOption[*ZeroShotClassificationPipeline]
- func WithIDLabelMap(labels map[int]string) backends.PipelineOption[*TabularPipeline]
- func WithIgnoreLabels(ignoreLabels []string) backends.PipelineOption[*TokenClassificationPipeline]
- func WithImageMode() backends.PipelineOption[*FeatureExtractionPipeline]
- func WithLabels(labels []string) backends.PipelineOption[*ZeroShotClassificationPipeline]
- func WithMaxAggregation() backends.PipelineOption[*TokenClassificationPipeline]
- func WithMaxLength(maxLength int) backends.PipelineOption[*TextGenerationPipeline]
- 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 WithSigmoid() backends.PipelineOption[*TextClassificationPipeline]
- func WithSimpleAggregation() backends.PipelineOption[*TokenClassificationPipeline]
- func WithSingleLabel() backends.PipelineOption[*TextClassificationPipeline]
- func WithSoftmax() backends.PipelineOption[*TextClassificationPipeline]
- func WithSortResults(sort bool) 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 WithTopK(topK int) backends.PipelineOption[*ImageClassificationPipeline]
- func WithTopP(topP float64) backends.PipelineOption[*TextGenerationPipeline]
- func WithoutAggregation() backends.PipelineOption[*TokenClassificationPipeline]
- type ClassificationOutput
- type CrossEncoderOutput
- type CrossEncoderPipeline
- func (p *CrossEncoderPipeline) Forward(batch *backends.PipelineBatch) error
- 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) Postprocess(batch *backends.PipelineBatch, documents []string) (*CrossEncoderOutput, error)
- func (p *CrossEncoderPipeline) Preprocess(batch *backends.PipelineBatch, inputs []string) error
- func (p *CrossEncoderPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
- func (p *CrossEncoderPipeline) RunPipeline(query string, documents []string) (*CrossEncoderOutput, error)
- func (p *CrossEncoderPipeline) Validate() error
- type CrossEncoderResult
- type CrossEncoderStatistics
- type Detection
- type Entity
- type FeatureExtractionOutput
- type FeatureExtractionPipeline
- func (p *FeatureExtractionPipeline) Forward(batch *backends.PipelineBatch) error
- 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) Postprocess(batch *backends.PipelineBatch) (*FeatureExtractionOutput, error)
- func (p *FeatureExtractionPipeline) Preprocess(batch *backends.PipelineBatch, inputs []string) error
- func (p *FeatureExtractionPipeline) PreprocessImages(batch *backends.PipelineBatch, inputs []image.Image) error
- func (p *FeatureExtractionPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
- func (p *FeatureExtractionPipeline) RunPipeline(inputs []string) (*FeatureExtractionOutput, error)
- func (p *FeatureExtractionPipeline) RunWithImagePaths(paths []string) (*FeatureExtractionOutput, error)
- func (p *FeatureExtractionPipeline) RunWithImages(images []image.Image) (*FeatureExtractionOutput, error)
- func (p *FeatureExtractionPipeline) Validate() error
- type ImageClassificationOutput
- type ImageClassificationPipeline
- func (p *ImageClassificationPipeline) Forward(batch *backends.PipelineBatch) error
- 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) Postprocess(batch *backends.PipelineBatch) (*ImageClassificationOutput, error)
- func (p *ImageClassificationPipeline) Preprocess(batch *backends.PipelineBatch, inputs []image.Image) error
- func (p *ImageClassificationPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
- func (p *ImageClassificationPipeline) RunPipeline(inputs []string) (*ImageClassificationOutput, error)
- func (p *ImageClassificationPipeline) RunWithImages(inputs []image.Image) (*ImageClassificationOutput, error)
- func (p *ImageClassificationPipeline) Validate() error
- type ImageClassificationResult
- type ObjectDetectionOutput
- type ObjectDetectionPipeline
- func (p *ObjectDetectionPipeline) Forward(batch *backends.PipelineBatch) error
- 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) Postprocess(batch *backends.PipelineBatch) (*ObjectDetectionOutput, error)
- func (p *ObjectDetectionPipeline) Preprocess(batch *backends.PipelineBatch, inputs []image.Image) error
- func (p *ObjectDetectionPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
- func (p *ObjectDetectionPipeline) RunPipeline(inputs []string) (*ObjectDetectionOutput, error)
- func (p *ObjectDetectionPipeline) RunWithImages(inputs []image.Image) (*ObjectDetectionOutput, error)
- func (p *ObjectDetectionPipeline) Validate() error
- type TabularClassificationOutput
- type TabularOutput
- type TabularPipeline
- func (p *TabularPipeline) Forward(batch *backends.PipelineBatch) error
- 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) Postprocess(batch *backends.PipelineBatch) (*TabularOutput, error)
- func (p *TabularPipeline) Preprocess(batch *backends.PipelineBatch, inputs [][]float32) error
- func (p *TabularPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
- func (p *TabularPipeline) RunPipeline(inputs [][]float32) (*TabularOutput, error)
- func (p *TabularPipeline) Validate() error
- type TextClassificationOutput
- type TextClassificationPipeline
- func (p *TextClassificationPipeline) Forward(batch *backends.PipelineBatch) error
- 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) Postprocess(batch *backends.PipelineBatch) (*TextClassificationOutput, error)
- func (p *TextClassificationPipeline) Preprocess(batch *backends.PipelineBatch, inputs []string) error
- func (p *TextClassificationPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
- func (p *TextClassificationPipeline) RunPipeline(inputs []string) (*TextClassificationOutput, error)
- func (p *TextClassificationPipeline) Validate() error
- type TextGenerationOutput
- type TextGenerationPipeline
- func (p *TextGenerationPipeline) Forward(ctx context.Context, batch *backends.PipelineBatch) (chan backends.SequenceDelta, chan error, error)
- 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) Preprocess(batch *backends.PipelineBatch, inputs any) error
- func (p *TextGenerationPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
- func (p *TextGenerationPipeline) RunMessages(ctx context.Context, inputs [][]backends.Message) (*TextGenerationOutput, error)
- func (p *TextGenerationPipeline) RunPipeline(ctx context.Context, inputs []string) (*TextGenerationOutput, error)
- func (p *TextGenerationPipeline) Validate() error
- type TokenClassificationOutput
- type TokenClassificationPipeline
- func (p *TokenClassificationPipeline) Aggregate(input backends.TokenizedInput, preEntities []Entity) ([]Entity, error)
- func (p *TokenClassificationPipeline) Forward(batch *backends.PipelineBatch) error
- func (p *TokenClassificationPipeline) GatherPreEntities(input backends.TokenizedInput, output [][]float32) []Entity
- func (p *TokenClassificationPipeline) GetMetadata() backends.PipelineMetadata
- func (p *TokenClassificationPipeline) GetModel() *backends.Model
- func (p *TokenClassificationPipeline) GetStatistics() backends.PipelineStatistics
- func (p *TokenClassificationPipeline) GroupEntities(entities []Entity) ([]Entity, error)
- func (p *TokenClassificationPipeline) IsGenerative() bool
- func (p *TokenClassificationPipeline) Postprocess(batch *backends.PipelineBatch) (*TokenClassificationOutput, error)
- func (p *TokenClassificationPipeline) Preprocess(batch *backends.PipelineBatch, inputs []string) error
- func (p *TokenClassificationPipeline) PreprocessWords(batch *backends.PipelineBatch, inputs [][]string) error
- func (p *TokenClassificationPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
- func (p *TokenClassificationPipeline) RunPipeline(inputs []string) (*TokenClassificationOutput, error)
- func (p *TokenClassificationPipeline) RunWords(inputs [][]string) (*TokenClassificationOutput, error)
- func (p *TokenClassificationPipeline) Validate() error
- type ZeroShotClassificationOutput
- type ZeroShotClassificationPipeline
- func (p *ZeroShotClassificationPipeline) Forward(batch *backends.PipelineBatch) error
- 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) Postprocess(outputTensors [][][]float32, labels []string, sequences []string) (*ZeroShotOutput, error)
- func (p *ZeroShotClassificationPipeline) Preprocess(batch *backends.PipelineBatch, inputs []string) error
- func (p *ZeroShotClassificationPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
- func (p *ZeroShotClassificationPipeline) RunPipeline(inputs []string) (*ZeroShotOutput, error)
- func (p *ZeroShotClassificationPipeline) Validate() error
- type ZeroShotOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 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]
Options.
func WithClassification ¶ added in v0.6.2
func WithClassification() backends.PipelineOption[*TabularPipeline]
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 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 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 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 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 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 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 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(sort bool) 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 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 WithoutAggregation ¶
func WithoutAggregation() backends.PipelineOption[*TokenClassificationPipeline]
WithoutAggregation returns the token labels.
Types ¶
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(config backends.PipelineConfig[*CrossEncoderPipeline], s *options.Options, model *backends.Model) (*CrossEncoderPipeline, error)
func (*CrossEncoderPipeline) Forward ¶ added in v0.5.0
func (p *CrossEncoderPipeline) Forward(batch *backends.PipelineBatch) 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
INTERFACE IMPLEMENTATIONS.
func (*CrossEncoderPipeline) Postprocess ¶ added in v0.5.0
func (p *CrossEncoderPipeline) Postprocess(batch *backends.PipelineBatch, documents []string) (*CrossEncoderOutput, error)
func (*CrossEncoderPipeline) Preprocess ¶ added in v0.5.0
func (p *CrossEncoderPipeline) Preprocess(batch *backends.PipelineBatch, inputs []string) error
func (*CrossEncoderPipeline) Run ¶ added in v0.5.0
func (p *CrossEncoderPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
func (*CrossEncoderPipeline) RunPipeline ¶ added in v0.5.0
func (p *CrossEncoderPipeline) RunPipeline(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 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(config backends.PipelineConfig[*FeatureExtractionPipeline], s *options.Options, model *backends.Model) (*FeatureExtractionPipeline, error)
NewFeatureExtractionPipeline init a feature extraction pipeline.
func (*FeatureExtractionPipeline) Forward ¶ added in v0.1.4
func (p *FeatureExtractionPipeline) Forward(batch *backends.PipelineBatch) error
Forward performs the forward inference of the 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) Postprocess ¶
func (p *FeatureExtractionPipeline) Postprocess(batch *backends.PipelineBatch) (*FeatureExtractionOutput, error)
Postprocess parses the first output from the network similar to the transformers' implementation.
func (*FeatureExtractionPipeline) Preprocess ¶ added in v0.1.4
func (p *FeatureExtractionPipeline) Preprocess(batch *backends.PipelineBatch, inputs []string) error
Preprocess tokenizes the input strings.
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(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(inputs []string) (*FeatureExtractionOutput, error)
RunPipeline is like Run, but returns the concrete feature extraction output type rather than the interface.
func (*FeatureExtractionPipeline) RunWithImagePaths ¶ added in v0.6.0
func (p *FeatureExtractionPipeline) RunWithImagePaths(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(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 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(config backends.PipelineConfig[*ImageClassificationPipeline], s *options.Options, model *backends.Model) (*ImageClassificationPipeline, error)
NewImageClassificationPipeline initializes an image classification pipeline.
func (*ImageClassificationPipeline) Forward ¶ added in v0.5.0
func (p *ImageClassificationPipeline) Forward(batch *backends.PipelineBatch) error
Forward runs inference.
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) Postprocess ¶ added in v0.5.0
func (p *ImageClassificationPipeline) Postprocess(batch *backends.PipelineBatch) (*ImageClassificationOutput, error)
Postprocess parses logits and returns top-k predictions for each image.
func (*ImageClassificationPipeline) Preprocess ¶ added in v0.5.0
func (p *ImageClassificationPipeline) Preprocess(batch *backends.PipelineBatch, inputs []image.Image) error
Preprocess decodes images from file paths or image.Image and creates input tensors. Preprocess loads images from file paths and creates input tensors.
func (*ImageClassificationPipeline) Run ¶ added in v0.5.0
func (p *ImageClassificationPipeline) Run(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(inputs []string) (*ImageClassificationOutput, error)
RunPipeline returns the concrete output type.
func (*ImageClassificationPipeline) RunWithImages ¶ added in v0.5.0
func (p *ImageClassificationPipeline) RunWithImages(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 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(config backends.PipelineConfig[*ObjectDetectionPipeline], s *options.Options, model *backends.Model) (*ObjectDetectionPipeline, error)
NewObjectDetectionPipeline initializes an object detection pipeline.
func (*ObjectDetectionPipeline) Forward ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) Forward(batch *backends.PipelineBatch) error
Forward inference.
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
Interface implementations.
func (*ObjectDetectionPipeline) Postprocess ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) Postprocess(batch *backends.PipelineBatch) (*ObjectDetectionOutput, error)
Postprocess parses boxes/scores, applies thresholds and NMS.
func (*ObjectDetectionPipeline) Preprocess ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) Preprocess(batch *backends.PipelineBatch, inputs []image.Image) error
Preprocess images into tensors.
func (*ObjectDetectionPipeline) Run ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
Run with file paths.
func (*ObjectDetectionPipeline) RunPipeline ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) RunPipeline(inputs []string) (*ObjectDetectionOutput, error)
func (*ObjectDetectionPipeline) RunWithImages ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) RunWithImages(inputs []image.Image) (*ObjectDetectionOutput, error)
func (*ObjectDetectionPipeline) Validate ¶ added in v0.6.0
func (p *ObjectDetectionPipeline) Validate() error
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
AggregationFunctionName string // for classification: SOFTMAX or SIGMOID
ProblemType string // "classification" or "regression"
IDLabelMap map[int]string // optional mapping from class IDs to labels
}
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(config backends.PipelineConfig[*TabularPipeline], s *options.Options, model *backends.Model) (*TabularPipeline, error)
NewTabularPipeline initializes the pipeline.
func (*TabularPipeline) Forward ¶ added in v0.6.2
func (p *TabularPipeline) Forward(batch *backends.PipelineBatch) error
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) Postprocess ¶ added in v0.6.2
func (p *TabularPipeline) Postprocess(batch *backends.PipelineBatch) (*TabularOutput, error)
func (*TabularPipeline) Preprocess ¶ added in v0.6.2
func (p *TabularPipeline) Preprocess(batch *backends.PipelineBatch, inputs [][]float32) error
Preprocess parses inputs strings into [][]float32 and builds tensors.
func (*TabularPipeline) Run ¶ added in v0.6.2
func (p *TabularPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
Run executes the pipeline over inputs.
func (*TabularPipeline) RunPipeline ¶ added in v0.6.2
func (p *TabularPipeline) RunPipeline(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(config backends.PipelineConfig[*TextClassificationPipeline], s *options.Options, model *backends.Model) (*TextClassificationPipeline, error)
NewTextClassificationPipeline initializes a new text classification pipeline.
func (*TextClassificationPipeline) Forward ¶
func (p *TextClassificationPipeline) Forward(batch *backends.PipelineBatch) error
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) Postprocess ¶
func (p *TextClassificationPipeline) Postprocess(batch *backends.PipelineBatch) (*TextClassificationOutput, error)
func (*TextClassificationPipeline) Preprocess ¶ added in v0.1.4
func (p *TextClassificationPipeline) Preprocess(batch *backends.PipelineBatch, inputs []string) error
Preprocess tokenizes the input strings.
func (*TextClassificationPipeline) Run ¶
func (p *TextClassificationPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
Run the pipeline on a string batch.
func (*TextClassificationPipeline) RunPipeline ¶ added in v0.0.6
func (p *TextClassificationPipeline) RunPipeline(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 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
SystemPrompt string
MaxLength int
Streaming bool
Temperature *float64
TopP *float64
Seed *int
StopSequences []string
}
func NewTextGenerationPipeline ¶ added in v0.5.0
func NewTextGenerationPipeline(config backends.PipelineConfig[*TextGenerationPipeline], s *options.Options, model *backends.Model) (*TextGenerationPipeline, error)
NewTextGenerationPipeline initializes a new text generation pipeline.
func (*TextGenerationPipeline) Forward ¶ added in v0.5.0
func (p *TextGenerationPipeline) Forward(ctx context.Context, batch *backends.PipelineBatch) (chan backends.SequenceDelta, chan error, error)
Forward initiates the generation loop.
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) Preprocess ¶ added in v0.5.0
func (p *TextGenerationPipeline) Preprocess(batch *backends.PipelineBatch, inputs any) error
func (*TextGenerationPipeline) Run ¶ added in v0.5.0
func (p *TextGenerationPipeline) Run(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)
RunMessages processes a batch of message inputs. If multimodal, the images should be added to the messages.
func (*TextGenerationPipeline) RunPipeline ¶ added in v0.5.0
func (p *TextGenerationPipeline) RunPipeline(ctx context.Context, inputs []string) (*TextGenerationOutput, error)
RunPipeline processes a batch of string inputs.
func (*TextGenerationPipeline) Validate ¶ added in v0.5.0
func (p *TextGenerationPipeline) Validate() 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
IgnoreLabels []string
SplitWords bool
}
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(config backends.PipelineConfig[*TokenClassificationPipeline], s *options.Options, model *backends.Model) (*TokenClassificationPipeline, error)
NewTokenClassificationPipeline Initializes a feature extraction pipeline.
func (*TokenClassificationPipeline) Aggregate ¶
func (p *TokenClassificationPipeline) Aggregate(input backends.TokenizedInput, preEntities []Entity) ([]Entity, error)
func (*TokenClassificationPipeline) Forward ¶ added in v0.1.4
func (p *TokenClassificationPipeline) Forward(batch *backends.PipelineBatch) error
Forward performs the forward inference of the pipeline.
func (*TokenClassificationPipeline) GatherPreEntities ¶
func (p *TokenClassificationPipeline) GatherPreEntities(input backends.TokenizedInput, output [][]float32) []Entity
GatherPreEntities from batch of logits to list of pre-aggregated outputs.
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) GroupEntities ¶
func (p *TokenClassificationPipeline) GroupEntities(entities []Entity) ([]Entity, error)
GroupEntities group together adjacent tokens with the same entity predicted.
func (*TokenClassificationPipeline) IsGenerative ¶ added in v0.6.0
func (p *TokenClassificationPipeline) IsGenerative() bool
func (*TokenClassificationPipeline) Postprocess ¶
func (p *TokenClassificationPipeline) Postprocess(batch *backends.PipelineBatch) (*TokenClassificationOutput, error)
Postprocess function for a token classification pipeline.
func (*TokenClassificationPipeline) Preprocess ¶ added in v0.1.4
func (p *TokenClassificationPipeline) Preprocess(batch *backends.PipelineBatch, inputs []string) error
Preprocess tokenizes the input strings.
func (*TokenClassificationPipeline) PreprocessWords ¶ added in v0.5.9
func (p *TokenClassificationPipeline) PreprocessWords(batch *backends.PipelineBatch, inputs [][]string) error
PreprocessWords tokenizes pre-split words and maps tokens to word IDs via offsets.
func (*TokenClassificationPipeline) Run ¶
func (p *TokenClassificationPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
Run the pipeline on a string batch.
func (*TokenClassificationPipeline) RunPipeline ¶ added in v0.0.6
func (p *TokenClassificationPipeline) RunPipeline(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(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) Validate ¶ added in v0.0.5
func (p *TokenClassificationPipeline) Validate() error
Validate checks that the pipeline is valid.
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(config backends.PipelineConfig[*ZeroShotClassificationPipeline], s *options.Options, model *backends.Model) (*ZeroShotClassificationPipeline, error)
NewZeroShotClassificationPipeline create new Zero Shot Classification Pipeline.
func (*ZeroShotClassificationPipeline) Forward ¶ added in v0.1.4
func (p *ZeroShotClassificationPipeline) Forward(batch *backends.PipelineBatch) error
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) Postprocess ¶ added in v0.1.4
func (p *ZeroShotClassificationPipeline) Postprocess(outputTensors [][][]float32, labels []string, sequences []string) (*ZeroShotOutput, error)
func (*ZeroShotClassificationPipeline) Preprocess ¶ added in v0.1.4
func (p *ZeroShotClassificationPipeline) Preprocess(batch *backends.PipelineBatch, inputs []string) error
func (*ZeroShotClassificationPipeline) Run ¶ added in v0.1.4
func (p *ZeroShotClassificationPipeline) Run(inputs []string) (backends.PipelineBatchOutput, error)
func (*ZeroShotClassificationPipeline) RunPipeline ¶ added in v0.1.4
func (p *ZeroShotClassificationPipeline) RunPipeline(inputs []string) (*ZeroShotOutput, error)
func (*ZeroShotClassificationPipeline) Validate ¶ added in v0.1.4
func (p *ZeroShotClassificationPipeline) 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.