CoolFace
Apppublic

Rob-Lobsta/Shining-Mythril

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes
vector.py13 linesDownload Raw Back to root
1from sentence_transformers import SentenceTransformer2from typing import List3 4class VectorModel:5    def __init__(self):6        # We use the 384-dim model recommended in the design7        self.model = SentenceTransformer('all-MiniLM-L6-v2')8 9    def encode(self, text: str) -> List[float]:10        return self.model.encode(text).tolist()11 12vector_model = VectorModel()13