Update main.py
This commit is contained in:
@@ -11,6 +11,7 @@ import pymongo
|
|||||||
import mongo_conn
|
import mongo_conn
|
||||||
import pgvec_conn
|
import pgvec_conn
|
||||||
import redis_conn
|
import redis_conn
|
||||||
|
from tqdm import tqdm
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
@@ -27,7 +28,8 @@ def retrieve_file_contents(path):
|
|||||||
|
|
||||||
contents = []
|
contents = []
|
||||||
|
|
||||||
for file in files:
|
print("Parsing files...")
|
||||||
|
for file in tqdm(files):
|
||||||
content = file_extraction_functions[file[0]](file[1])
|
content = file_extraction_functions[file[0]](file[1])
|
||||||
contents.append({
|
contents.append({
|
||||||
"type": file[0],
|
"type": file[0],
|
||||||
@@ -64,7 +66,8 @@ def create_embeddings(pContent):
|
|||||||
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
for content in pContent:
|
print("generating embeddings...")
|
||||||
|
for content in tqdm(pContent):
|
||||||
for chunk in chunker.generate_chunks(content["content"]):
|
for chunk in chunker.generate_chunks(content["content"]):
|
||||||
merged_info = "Dateiname: " + content["filename"] + " Dateiinhalt: " + chunk
|
merged_info = "Dateiname: " + content["filename"] + " Dateiinhalt: " + chunk
|
||||||
# print(merged_info)
|
# print(merged_info)
|
||||||
|
|||||||
Reference in New Issue
Block a user