Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EmbeddingModel ¶
type EmbeddingModel string
Enum-type representing the available embedding models
const ( AllMiniLML6V2 EmbeddingModel = "fast-all-MiniLM-L6-v2" BGEBaseEN EmbeddingModel = "fast-bge-base-en" BGESmallEN EmbeddingModel = "fast-bge-small-en" )
type FlagEmbedding ¶
type FlagEmbedding struct {
// contains filtered or unexported fields
}
func NewFlagEmbedding ¶
func NewFlagEmbedding(options *InitOptions) (*FlagEmbedding, error)
func (*FlagEmbedding) Destroy ¶
func (f *FlagEmbedding) Destroy()
Call this function to cleanup the internal onnxruntime environment when it is no longer needed.
func (*FlagEmbedding) Embed ¶
func (f *FlagEmbedding) Embed(input []string, batchSize int) ([]([]float32), error)
func (*FlagEmbedding) PassageEmbed ¶
func (f *FlagEmbedding) PassageEmbed(input []string, batchSize int) ([]([]float32), error)
func (*FlagEmbedding) QueryEmbed ¶
func (f *FlagEmbedding) QueryEmbed(input string) ([]float32, error)
type InitOptions ¶
type InitOptions struct { Model EmbeddingModel ExecutionProviders []string MaxLength int CacheDir string ShowDownloadProgress *bool OnnxPath string }
NOTE: We use a pointer for "ShowDownloadProgress" so that we can distinguish between the user not setting this flag and the user setting it to false. As Go assigns a default(empty) value of "false" to bools, we can't distinguish if the user set it to false or not set at all. A pointer to bool will be nil if not set explicitly
Click to show internal directories.
Click to hide internal directories.