From be6d5b76c31ad7f1ca6d0db50e569b67fe036816 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Fri, 19 Jul 2024 09:22:59 +0800 Subject: [PATCH] fix embeding model for Azure (#1601) ### What problem does this PR solve? #1599 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/llm/embedding_model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rag/llm/embedding_model.py b/rag/llm/embedding_model.py index 06cc56975d6..1774bc2857c 100644 --- a/rag/llm/embedding_model.py +++ b/rag/llm/embedding_model.py @@ -111,11 +111,12 @@ def encode_queries(self, text): return np.array(res.data[0].embedding), res.usage.total_tokens -class AzureEmbed(Base): +class AzureEmbed(OpenAIEmbed): def __init__(self, key, model_name, **kwargs): self.client = AzureOpenAI(api_key=key, azure_endpoint=kwargs["base_url"], api_version="2024-02-01") self.model_name = model_name + class BaiChuanEmbed(OpenAIEmbed): def __init__(self, key, model_name='Baichuan-Text-Embedding',