Spaces:
Runtime error
Runtime error
Download get_embedding_function.py from Neurolingua/AgriChatbot: direct link, hf CLI and curl.
- Browser
- Download file 289 Bytes
-
https://huggingface.co/spaces/Neurolingua/AgriChatbot/resolve/main/get_embedding_function.py
- Command line
-
hf download hf://spaces/Neurolingua/AgriChatbot/get_embedding_function.py
-
curl -L -o get_embedding_function.py https://huggingface.co/spaces/Neurolingua/AgriChatbot/resolve/main/get_embedding_function.py
289 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 | |