Spaces:
Sleeping
Sleeping
dinhquangson
commited on
Commit
•
737d35b
1
Parent(s):
316f3a8
Update app.py
Browse files
app.py
CHANGED
@@ -136,8 +136,8 @@ async def create_upload_file(text_field: str, file: UploadFile = File(...), ocr:
|
|
136 |
|
137 |
|
138 |
indexing = Pipeline()
|
139 |
-
indexing.add_component("sparse_doc_embedder", FastembedSparseDocumentEmbedder(model="
|
140 |
-
indexing.add_component("dense_doc_embedder", FastembedDocumentEmbedder(model="BAAI/bge-
|
141 |
indexing.add_component("writer", DocumentWriter(document_store=document_store, policy=DuplicatePolicy.OVERWRITE))
|
142 |
indexing.connect("sparse_doc_embedder", "dense_doc_embedder")
|
143 |
indexing.connect("dense_doc_embedder", "writer")
|
@@ -167,9 +167,9 @@ def search(prompt: str):
|
|
167 |
# Querying
|
168 |
|
169 |
querying = Pipeline()
|
170 |
-
querying.add_component("sparse_text_embedder", FastembedSparseTextEmbedder(model="
|
171 |
querying.add_component("dense_text_embedder", FastembedTextEmbedder(
|
172 |
-
model="BAAI/bge-
|
173 |
)
|
174 |
querying.add_component("retriever", QdrantHybridRetriever(document_store=document_store))
|
175 |
querying.add_component("document_joiner", DocumentJoiner())
|
|
|
136 |
|
137 |
|
138 |
indexing = Pipeline()
|
139 |
+
indexing.add_component("sparse_doc_embedder", FastembedSparseDocumentEmbedder(model="Qdrant/bm42-all-minilm-l6-v2-attentions"))
|
140 |
+
indexing.add_component("dense_doc_embedder", FastembedDocumentEmbedder(model="BAAI/bge-m3"))
|
141 |
indexing.add_component("writer", DocumentWriter(document_store=document_store, policy=DuplicatePolicy.OVERWRITE))
|
142 |
indexing.connect("sparse_doc_embedder", "dense_doc_embedder")
|
143 |
indexing.connect("dense_doc_embedder", "writer")
|
|
|
167 |
# Querying
|
168 |
|
169 |
querying = Pipeline()
|
170 |
+
querying.add_component("sparse_text_embedder", FastembedSparseTextEmbedder(model="Qdrant/bm42-all-minilm-l6-v2-attentions"))
|
171 |
querying.add_component("dense_text_embedder", FastembedTextEmbedder(
|
172 |
+
model="BAAI/bge-m3", prefix="Represent this sentence for searching relevant passages: ")
|
173 |
)
|
174 |
querying.add_component("retriever", QdrantHybridRetriever(document_store=document_store))
|
175 |
querying.add_component("document_joiner", DocumentJoiner())
|