mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-11-03 03:09:49 +00:00
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)
This commit is contained in:
parent
fb21efd77d
commit
be6d5b76c3
@ -111,11 +111,12 @@ class OpenAIEmbed(Base):
|
|||||||
return np.array(res.data[0].embedding), res.usage.total_tokens
|
return np.array(res.data[0].embedding), res.usage.total_tokens
|
||||||
|
|
||||||
|
|
||||||
class AzureEmbed(Base):
|
class AzureEmbed(OpenAIEmbed):
|
||||||
def __init__(self, key, model_name, **kwargs):
|
def __init__(self, key, model_name, **kwargs):
|
||||||
self.client = AzureOpenAI(api_key=key, azure_endpoint=kwargs["base_url"], api_version="2024-02-01")
|
self.client = AzureOpenAI(api_key=key, azure_endpoint=kwargs["base_url"], api_version="2024-02-01")
|
||||||
self.model_name = model_name
|
self.model_name = model_name
|
||||||
|
|
||||||
|
|
||||||
class BaiChuanEmbed(OpenAIEmbed):
|
class BaiChuanEmbed(OpenAIEmbed):
|
||||||
def __init__(self, key,
|
def __init__(self, key,
|
||||||
model_name='Baichuan-Text-Embedding',
|
model_name='Baichuan-Text-Embedding',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user