Update app.py
Browse files
app.py
CHANGED
|
@@ -12,8 +12,14 @@ import json
|
|
| 12 |
import io
|
| 13 |
|
| 14 |
app = FastAPI()
|
| 15 |
-
model = SentenceTransformer('
|
| 16 |
-
embedding_dimension = 384 # 384 is the dimensionality of the MiniLM model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
index = faiss.IndexFlatL2(embedding_dimension)
|
| 18 |
documents = []
|
| 19 |
|
|
|
|
| 12 |
import io
|
| 13 |
|
| 14 |
app = FastAPI()
|
| 15 |
+
#model = SentenceTransformer('paraphrase-MiniLM-L6-v2')
|
| 16 |
+
#embedding_dimension = 384 # 384 is the dimensionality of the MiniLM model
|
| 17 |
+
#1. Specify preffered dimensions
|
| 18 |
+
embedding_dimension = 512
|
| 19 |
+
# 2. load model
|
| 20 |
+
model = SentenceTransformer("mixedbread-ai/mxbai-embed-large-v1", truncate_dim=embedding_dimension)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
index = faiss.IndexFlatL2(embedding_dimension)
|
| 24 |
documents = []
|
| 25 |
|