1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Utilities to help with the embeddings output.
//!
//! Typically, [`ort::Session::run`] will generate a [`ort::SessionOutputs`] object.
//! This object contains all the keys and values of the outputs generated by the model,
//! which could all be useful to the caller.
//!
//! This module wraps the [`ort::SessionOutputs`] objects created from batching,
//! and provides a more refined and controlled way to access all the outputs.
//!
//! # Notable structs
//!
//! - [`OutputPrecedence`]: This trait defines the order of precedence for selecting the output
//! from the session outputs. This is simply an iterator of [`OutputKey`].
//! - [`OutputKey`]: This enum defines a single way of selecting the output from the session outputs.
//! It could be by order, by name, or the only option available. This can be further
//! extended to include more ways of selecting the output.
//! - [`SingleBatchOutput`]: This struct contains the output of a single batch of inference. It
//! should also include all the necessary information to perform per-batch post-processing such
//! as pooling.
//! - [`EmbeddingOutput`]: This struct wraps the [`ort::SessionOutputs`] objects, acting as a
//! staging area for the raw model outputs. Models that have multiple output types, or
//! have different dimensions as expected can be handled within.
//!
//! It provides [`EmbeddingOutput::export_with_transformer`] which allows the user to
//! provide a custom transformer to extract the output from the [`SingleBatchOutput`] objects.
//!
//! # Implementation
//!
//! Modules which generate text embeddings should each define their own default [`OutputPrecedence`]
//! and public helper functions to create the array transformers. These default implementations
//! allow the current [embed] methods to function as before, but also allow the user more flexibility in
//! extracting the output by using the [transform] method with a custom transformer.
//!
//! [embed]: TextEmbedding::embed
//! [transform]: TextEmbedding::transform
// mod output_type;
pub use *;
pub use *;
// pub use output_type::*;
use crateTextEmbedding;