Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -71,8 +71,9 @@ def main(query: str, client: QdrantClient, collection_name: str, llm: Llama, den
|
|
71 |
scored_points = query_hybrid_search(query, client, collection_name, dense_model, sparse_model)
|
72 |
print(scored_points)
|
73 |
|
74 |
-
docs = [
|
75 |
-
contents
|
|
|
76 |
|
77 |
context = "\n".join(contents)
|
78 |
|
@@ -284,8 +285,9 @@ def chunk_documents(texts: List[str], metadatas: List[dict], dense_model: Optimu
|
|
284 |
final = end - start
|
285 |
print(f'FINAL CHUNKING TIME: {final}')
|
286 |
|
287 |
-
|
288 |
-
documents
|
|
|
289 |
print(f'CHUNKS : {documents}')
|
290 |
|
291 |
start_dense = time.time()
|
|
|
71 |
scored_points = query_hybrid_search(query, client, collection_name, dense_model, sparse_model)
|
72 |
print(scored_points)
|
73 |
|
74 |
+
docs = [scored_point.payload for scored_point in scored_points]
|
75 |
+
contents = [t['text'] for t in docs]
|
76 |
+
metadatas = [t['metadata'] for t in docs]
|
77 |
|
78 |
context = "\n".join(contents)
|
79 |
|
|
|
285 |
final = end - start
|
286 |
print(f'FINAL CHUNKING TIME: {final}')
|
287 |
|
288 |
+
docs = [for sub_chunk in chunks for chunk in sub_chunk]
|
289 |
+
documents = [doc.content for doc in docs]
|
290 |
+
metadatas_docs = [doc.metadata for doc in docs]
|
291 |
print(f'CHUNKS : {documents}')
|
292 |
|
293 |
start_dense = time.time()
|