sheet_rag_chatbot / src /services /sentence-embedding.py
hohieu's picture
deploy to hunger face
205b451
raw
history blame
326 Bytes
from langchain_community.embeddings.sentence_transformer import (
SentenceTransformerEmbeddings
)
model = SentenceTransformerEmbeddings(model_name="vinai/phobert-base-v2")
query = 'This framework generates embeddings for each input sentence'
sentence_embeddings = model.embed_query(query)
print(len(sentence_embeddings))