Update app.py
Browse files
app.py
CHANGED
@@ -74,7 +74,7 @@ if not HF_TOKEN:
|
|
74 |
exit(1)
|
75 |
|
76 |
# HuggingFace Embeddings
|
77 |
-
embeddings = HuggingFaceEmbeddings(model_name="
|
78 |
|
79 |
# Qdrant Client Setup
|
80 |
try:
|
@@ -95,7 +95,7 @@ try:
|
|
95 |
client.create_collection(
|
96 |
collection_name=collection_name,
|
97 |
vectors_config=models.VectorParams(
|
98 |
-
size=
|
99 |
distance=models.Distance.COSINE
|
100 |
)
|
101 |
)
|
@@ -115,16 +115,16 @@ db = Qdrant(
|
|
115 |
)
|
116 |
|
117 |
# Create retriever
|
118 |
-
# retriever = db.as_retriever(
|
119 |
-
# search_type="similarity",
|
120 |
-
# search_kwargs={"k": 5}
|
121 |
-
# )
|
122 |
-
|
123 |
retriever = db.as_retriever(
|
124 |
-
search_type="
|
125 |
-
search_kwargs={"k": 5
|
126 |
)
|
127 |
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
|
130 |
|
|
|
74 |
exit(1)
|
75 |
|
76 |
# HuggingFace Embeddings
|
77 |
+
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
|
78 |
|
79 |
# Qdrant Client Setup
|
80 |
try:
|
|
|
95 |
client.create_collection(
|
96 |
collection_name=collection_name,
|
97 |
vectors_config=models.VectorParams(
|
98 |
+
size=384, # GTE-large embedding size
|
99 |
distance=models.Distance.COSINE
|
100 |
)
|
101 |
)
|
|
|
115 |
)
|
116 |
|
117 |
# Create retriever
|
|
|
|
|
|
|
|
|
|
|
118 |
retriever = db.as_retriever(
|
119 |
+
search_type="similarity",
|
120 |
+
search_kwargs={"k": 5}
|
121 |
)
|
122 |
|
123 |
+
# retriever = db.as_retriever(
|
124 |
+
# search_type="mmr",
|
125 |
+
# search_kwargs={"k": 5, "fetch_k": 10, "lambda_mult": 0.5}
|
126 |
+
# )
|
127 |
+
|
128 |
|
129 |
|
130 |
|