Fix voyage embedding. (#3818)

### What problem does this PR solve?

#3816 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2024-12-03 09:33:54 +08:00 committed by GitHub
parent ed7e46b6ca
commit 6a0583f5ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -680,11 +680,10 @@ class VoyageEmbed(Base):
return np.array(res.embeddings), res.total_tokens
def encode_queries(self, text):
res = self.client.embed
res = self.client.embed(
texts=text, model=self.model_name, input_type="query"
)
return np.array(res.embeddings), res.total_tokens
return np.array(res.embeddings)[0], res.total_tokens
class HuggingFaceEmbed(Base):