AgriChatbot / get_embedding_function.py
Neurolingua's picture
Create get_embedding_function.py
6bd56da verified
raw
history blame
284 Bytes
from langchain.embeddings import HuggingFaceEmbeddings
def get_embedding_function():
model_name = "sentence-transformers/all-mpnet-base-v2" # You can change this to any other Hugging Face model
embeddings = HuggingFaceEmbeddings(model_name=model_name)
return embeddings