Download src/loaders/elastic.py from kbl2810/test: direct link, hf CLI and curl.
- Browser
- Download file 338 Bytes
-
https://huggingface.co/spaces/kbl2810/test/resolve/main/src/loaders/elastic.py
- Command line
-
hf download hf://spaces/kbl2810/test/src/loaders/elastic.py
-
curl -L -o elastic.py https://huggingface.co/spaces/kbl2810/test/resolve/main/src/loaders/elastic.py
338 Bytes
| from elasticsearch import Elasticsearch | |
| from env import config | |
| class Elastic: | |
| _instance = None | |
| def __new__(cls): | |
| if cls._instance is None: | |
| cls._instance = Elasticsearch( | |
| config["elastic"]["url"], | |
| api_key=config["elastic"]["api_key"] | |
| ) | |
| return cls._instance | |