Spaces:
Build error
Build error
Download embedding.py from Jurai-aps/Demo_Chat_domsdatabasen: direct link, hf CLI and curl.
- Browser
- Download file 293 Bytes
-
https://huggingface.co/spaces/Jurai-aps/Demo_Chat_domsdatabasen/resolve/main/embedding.py
- Command line
-
hf download hf://spaces/Jurai-aps/Demo_Chat_domsdatabasen/embedding.py
-
curl -L -o embedding.py https://huggingface.co/spaces/Jurai-aps/Demo_Chat_domsdatabasen/resolve/main/embedding.py
293 Bytes
| from langchain.embeddings import HuggingFaceInferenceAPIEmbeddings | |
| from dotenv import load_dotenv | |
| import os | |
| load_dotenv() | |
| api_key = os.getenv("HUGGINGFACEHUB_API_TOKEN") | |
| embeddings = HuggingFaceInferenceAPIEmbeddings( | |
| api_key=api_key, model_name="sentence-transformers/all-MiniLM-L6-v2" | |
| ) |