pub trait VectorSpace: Sync + Send + 'static { }
Expand description

The type of a vector space marks what model the vector space is from. You should only combine vector spaces that come from the same model.

For example, the Llama model has a different vector space than the Bert model. Comparing these two vector spaces would not make sense because different parts of each vector encode different information. This trait allows you to mark an embedding with the type of vector space it comes from to avoid problems combing vector spaces.

If you want to cast an embedding from one vector space to another, you can use the Embedding::cast method. You can cast to the UnknownVectorSpace to erase the vector space type.

Implementors§