Explorar el Código

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>
tags/v0.9.0
江不江 hace 1 año
padre
commit
bc50f68127
No account linked to committer's email address
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2
    2
      rag/llm/embedding_model.py

+ 2
- 2
rag/llm/embedding_model.py Ver fichero

) # local embedding for LmStudio donot count tokens ) # local embedding for LmStudio donot count tokens


def encode_queries(self, text): 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): class AzureEmbed(OpenAIEmbed):

Cargando…
Cancelar
Guardar