Spaces:
Runtime error
Runtime error
Create get_embedding_function.py
Browse files
get_embedding_function.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from langchain_community.embeddings import HuggingFaceInferenceAPIEmbeddings
|
2 |
+
from
|
3 |
+
def get_embedding_function():
|
4 |
+
embeddings = HuggingFaceInferenceAPIEmbeddings(
|
5 |
+
api_key=os.environ.get("HUGGINGFACE_API_KEY"), model_name="BAAI/bge-large-en-v1.5"
|
6 |
+
)
|
7 |
+
return embeddings
|