janar commited on
Commit
5fa437b
·
1 Parent(s): 1bec7d8

add the embedding config file

Browse files
Files changed (1) hide show
  1. api/db/embedding.py +10 -0
api/db/embedding.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from collections import namedtuple
2
+ from langchain.embeddings import OpenAIEmbeddings, ElasticsearchEmbeddings, SentenceTransformerEmbeddings
3
+
4
+ Embedding = namedtuple("Embedding",["embedding", "dimension", "distance"])
5
+
6
+ EMBEDDINGS = {
7
+ 'SENTENCE': Embedding(SentenceTransformerEmbeddings(),768, "Cosine"),
8
+ 'OPEN_AI': Embedding(OpenAIEmbeddings(), 1563, "Cosine"),
9
+ }
10
+