fix embedding_model (#1698)
### What problem does this PR solve? fix embedding_model #1692 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Signed-off-by: seaver <zhudan187@qq.com>
This commit is contained in:
parent
b24abee364
commit
bc50f68127
1 changed files with 2 additions and 2 deletions
|
|
@ -128,8 +128,8 @@ class LocalAIEmbed(Base):
|
|||
) # local embedding for LmStudio donot count tokens
|
||||
|
||||
def encode_queries(self, text):
|
||||
res = self.client.embeddings.create(text, model=self.model_name)
|
||||
return np.array(res.data[0].embedding), 1024
|
||||
embds, cnt = self.encode([text])
|
||||
return np.array(embds[0]), cnt
|
||||
|
||||
|
||||
class AzureEmbed(OpenAIEmbed):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue