I have the following function that was returning int8 correctly when the new Embed API that support int8 and binary embeddings was published. However, the same code blocks seems to return floats with a single decimal zero. Is this a known bug or by design? The workaround is converting to ints directly in python.
def generate_embeddings(texts, input_type="search_document"):
model = "embed-english-v3.0"
# Ensure texts is a list
if isinstance(texts, str):
texts = [texts]
response = co.embed(
texts=texts,
model=model,
input_type=input_type,
embedding_types=["int8"],
)
# Bug: There seems to be a bug in Cohere's Embed API that returns the embeddings as floats instead of integers
# Convert each embedding value to an integer
return [[int(value) for value in embedding] for embedding in response.embeddings.int8]
I have the following function that was returning int8 correctly when the new Embed API that support int8 and binary embeddings was published. However, the same code blocks seems to return floats with a single decimal zero. Is this a known bug or by design? The workaround is converting to ints directly in python.