-
I start a server with
Then when I get the embeddings, it seems like I get multiple vectors in return.
I think these are 4 distinct vectors. Each of them have as many elements as I expect in a single embedding vector.
The number of vectors I get changes with the length of the text. My guess is that it's tokenizing and then embedding each of the tokens, or something similar. I'm not sure why it would do that though. Any ideas how I can get the embedding vector for the whole string? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Alright, I found a bit more. This is affected by the Using Maybe I misunderstand what is going on though. |
Beta Was this translation helpful? Give feedback.
Alright, I found a bit more. This is affected by the
--pooling
flag. Like this, it will just generate a vector for every token.Using
--pooling cls
generates a single vector for classification. If I understand correctly, it picks a representative token, which doesn't sound right to me. I expect that the embedding model creates an embedding over the whole string, not just looking at a specific token to generate the embedding.Maybe I misunderstand what is going on though.