Spaces:
Sleeping
Sleeping
File size: 335 Bytes
83ad75c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | from sentence_transformers import SentenceTransformer
# Load once
embedding_model = SentenceTransformer(
"all-MiniLM-L6-v2"
)
def create_embeddings(texts):
"""
Convert text chunks into vectors
"""
embeddings = embedding_model.encode(
texts,
show_progress_bar=False
)
return embeddings |