Spaces:
Sleeping
Sleeping
Neurolingua
commited on
Commit
•
6bd56da
1
Parent(s):
665dd45
Create get_embedding_function.py
Browse files
get_embedding_function.py
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from langchain.embeddings import HuggingFaceEmbeddings
|
2 |
+
|
3 |
+
def get_embedding_function():
|
4 |
+
model_name = "sentence-transformers/all-mpnet-base-v2" # You can change this to any other Hugging Face model
|
5 |
+
embeddings = HuggingFaceEmbeddings(model_name=model_name)
|
6 |
+
return embeddings
|