Spaces:
Sleeping
Sleeping
Download app/utils.py from mtyrrell/chatfed_reranker: direct link, hf CLI and curl.
- Browser
- Download file 370 Bytes
-
https://huggingface.co/spaces/mtyrrell/chatfed_reranker/resolve/main/app/utils.py
- Command line
-
hf download hf://spaces/mtyrrell/chatfed_reranker/app/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/mtyrrell/chatfed_reranker/resolve/main/app/utils.py
370 Bytes
| import configparser | |
| import logging | |
| def getconfig(configfile_path: str): | |
| """ | |
| Read the config file | |
| Params | |
| ---------------- | |
| configfile_path: file path of .cfg file | |
| """ | |
| config = configparser.ConfigParser() | |
| try: | |
| config.read_file(open(configfile_path)) | |
| return config | |
| except: | |
| logging.warning("config file not found") |