phi-3-RAG / embeddings.py
dmedhi's picture
chat appication
6917098
raw
history blame contribute delete
278 Bytes
from typing import List
import torch
from sentence_transformers import SentenceTransformer
class Embedding:
model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
@classmethod
def encode_text(cls, text: str):
return cls.model.encode(text)