npv2k1's picture
feat: add hello world endpoint with embedding and introduce plot endpoint
4a485db
raw
history blame contribute delete
242 Bytes
from sentence_transformers import SentenceTransformer
# Load embedding model once when the server starts
model = SentenceTransformer("all-MiniLM-L6-v2")
def embed_text(req):
embedding = model.encode(req).tolist()
return embedding