Why is EmbeddingResponse.Embedding of type List<double> instead of List<float>? #509
-
OpenAI API returns a list of floats: https://platform.openai.com/docs/api-reference/embeddings/object Betalgo converts the result to a list of doubles: https://github.com/betalgo/openai/blob/master/OpenAI.SDK/ObjectModels/ResponseModels/EmbeddingCreateResponse.cs PgVector expects an array of floats: https://github.com/pgvector/pgvector-dotnet/blob/master/src/Pgvector/Vector.cs There is a chain of unnecessary conversions in my scenario: float (OpenAI) -> double (Betalgo) -> float (Pgvector). Why does EmbeddingResponse return |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is an open issue, and I am considering using double instead of float. I am not sure when OpenAI updated their response, but previously they were returning 18 digits, which is a higher capacity than float can carry. |
Beta Was this translation helpful? Give feedback.
This is an open issue, and I am considering using double instead of float. I am not sure when OpenAI updated their response, but previously they were returning 18 digits, which is a higher capacity than float can carry.
#219