Test2 / embedding.py
AlterM's picture
Duplicate from RisticksAI/ProfNet4
2f500b5
raw
history blame
217 Bytes
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('inkoziev/sbert_pq')
def getvec(text: str):
sentences = [text,]
embeddings = model.encode(sentences)
return embeddings[0]