我正在使用带有Azure OpenAI和Azure Cognitive Search的langchain. 目前我正在使用Azure OpenAI Text-Embedding-ada-002模型来生成嵌入,但如果可能的话,我想使用HugginFace的嵌入模型,因为Azure OpenAI API不允许批量发送文档,所以我需要进行多次调用并达到速率限制.
我try 在我的代码中使用此嵌入:
embeddings = SentenceTransformerEmbeddings(
model_name="all-mpnet-base-v2",
)
不是:
embeddings = OpenAIEmbeddings(
...
)
我面临的问题是,当我使用AzureSearch的aadd_texts
方法时,我得到了这个错误:
The vector field 'content_vector' dimensionality must match the field definition's 'dimensions' property. Expected: '1536'. Actual: '768'. (IndexDocumentsFieldError) 98: The vector field 'content_vector' dimensionality must match the field definition's 'dimensions' property. Expected: '1536'. Actual: '768'.
Code: IndexDocumentsFieldError
我完全迷路了.有没有人在Cognitive Search中使用开源嵌入模型?多么?