Spaces:
Runtime error
Runtime error
from sentence_transformers import SentenceTransformer | |
# Connect using a MilvusClient object | |
from pymilvus import Collection | |
from db_connect import connect | |
# | |
with open('responses.txt', 'r') as file: | |
content = file.read() | |
contents = content.split('\n\n') | |
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2') | |
embeddings = model.encode(contents) | |
data = [ | |
contents, | |
embeddings | |
] | |
connect() | |
collection = Collection("Response") | |
collection.insert(data) | |
collection.flush() | |