Download config_loader.py from Qar-Raz/NLP-RAG: direct link, hf CLI and curl.
- Browser
- Download file 632 Bytes
-
https://huggingface.co/spaces/Qar-Raz/NLP-RAG/resolve/main/config_loader.py
- Command line
-
hf download hf://spaces/Qar-Raz/NLP-RAG/config_loader.py
-
curl -L -o config_loader.py https://huggingface.co/spaces/Qar-Raz/NLP-RAG/resolve/main/config_loader.py
632 Bytes
| import yaml | |
| from pathlib import Path | |
| class RAGConfig: | |
| def __init__(self, config_path="config.yaml"): | |
| with open(config_path, 'r') as f: | |
| self.data = yaml.safe_load(f) | |
| def project(self): return self.data['project'] | |
| def processing(self): return self.data['processing'] | |
| def db(self): return self.data['vector_db'] | |
| def retrieval(self): return self.data['retrieval'] | |
| def gen(self): return self.data['generation'] | |
| def model_list(self): return self.data['models'] | |
| cfg = RAGConfig() |