Open lydacious opened 1 year ago
same here, suspect related to version issue of certain package.
You need to call the collection.load
interface after insert. https://milvus.io/docs/load_collection.md
instead of inserting each row separately, I inserted all rows as a batch and this error was resolved:
%%time
from towhee import pipe, ops
import numpy as np
from towhee.datacollection import DataCollection
insert_pipe = (
pipe.input('id', 'question', 'answer')
.map('question', 'vec', ops.text_embedding.dpr(model_name='facebook/dpr-ctx_encoder-single-nq-base'))
.map('vec', 'vec', lambda x: x / np.linalg.norm(x, axis=0))
.map(('id', 'vec'), 'insert_status', ops.ann_insert.milvus_client(host='127.0.0.1', port='19530', collection_name='question_answer'))
.output()
)
import csv
with open('question_answer.csv', encoding='utf-8') as f:
reader = csv.reader(f)
next(reader)
allRows=[]
for row in reader:
allRows.append(row)
res=insert_pipe.batch(allRows)
Hello, I am following the guide on creating a question-answering engine. I have done everything the same as the guide, but the collection stays empty for some reason. Before pasting the code here, this is the list of what I've done so far:
Code: