Spaces:
Paused
Paused
Download myenv/lib/python3.12/site-packages/chromadb/cli/utils.py from Dhenenjay/Term-4-Project: direct link, hf CLI and curl.
- Browser
- Download file 573 Bytes
-
https://huggingface.co/spaces/Dhenenjay/Term-4-Project/resolve/main/myenv/lib/python3.12/site-packages/chromadb/cli/utils.py
- Command line
-
hf download hf://spaces/Dhenenjay/Term-4-Project/myenv/lib/python3.12/site-packages/chromadb/cli/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/Dhenenjay/Term-4-Project/resolve/main/myenv/lib/python3.12/site-packages/chromadb/cli/utils.py
573 Bytes
| from typing import Any, Dict | |
| import yaml | |
| def set_log_file_path( | |
| log_config_path: str, new_filename: str = "chroma.log" | |
| ) -> Dict[str, Any]: | |
| """This works with the standard log_config.yml file. | |
| It will not work with custom log configs that may use different handlers""" | |
| with open(f"{log_config_path}", "r") as file: | |
| log_config = yaml.safe_load(file) | |
| for handler in log_config["handlers"].values(): | |
| if handler.get("class") == "logging.handlers.RotatingFileHandler": | |
| handler["filename"] = new_filename | |
| return log_config | |