lülülülü
This commit is contained in:
@@ -49,7 +49,6 @@ def create_embeddings(pContent):
|
||||
create_table_query = '''
|
||||
create table if not exists dbtable (
|
||||
id SERIAL PRIMARY KEY,
|
||||
doc_id Serial NOT NULL,
|
||||
filepath TEXT NOT NULL,
|
||||
embedding VECTOR NOT NULL
|
||||
);
|
||||
@@ -67,7 +66,7 @@ def create_embeddings(pContent):
|
||||
# print(merged_info)
|
||||
response = ollama.embeddings(model="mxbai-embed-large", prompt=merged_info)
|
||||
#embedding_list.append(response["embedding"])
|
||||
insert_data = f"insert into dbtable (filepath, embedding) Values ('{content['path']}', %s) Returning doc_id;"
|
||||
insert_data = f"insert into dbtable (filepath, embedding) Values ('{content['path']}', %s) Returning id;"
|
||||
cur.execute(insert_data, (response["embedding"],))
|
||||
doc_id = cur.fetchone()[0]
|
||||
insert_data_mongo(doc_id, chunk)
|
||||
|
||||
Reference in New Issue
Block a user