Skip to content

Commit

Permalink
fix embeding model for Azure (infiniflow#1601)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

infiniflow#1599

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh authored Jul 19, 2024
1 parent c9038ff commit 3684605
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rag/llm/embedding_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 3684605

Please sign in to comment.