Download src/utils.py from Lavender825/Sentiment_Analysis_3W0624: direct link, hf CLI and curl.
- Browser
- Download file 554 Bytes
-
https://huggingface.co/spaces/Lavender825/Sentiment_Analysis_3W0624/resolve/main/src/utils.py
- Command line
-
hf download hf://spaces/Lavender825/Sentiment_Analysis_3W0624/src/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/Lavender825/Sentiment_Analysis_3W0624/resolve/main/src/utils.py
554 Bytes
| """Utility helpers.""" | |
| import logging | |
| import sys | |
| def setup_logging(level=logging.INFO): | |
| logging.basicConfig( | |
| level=level, | |
| format="%(asctime)s | %(levelname)s | %(name)s | %(message)s", | |
| handlers=[logging.StreamHandler(sys.stdout)], | |
| force=True, | |
| ) | |
| # Quiet HuggingFace | |
| logging.getLogger("transformers").setLevel(logging.WARNING) | |
| logging.getLogger("datasets").setLevel(logging.WARNING) | |
| logging.getLogger("urllib3").setLevel(logging.WARNING) | |
| logging.getLogger("filelock").setLevel(logging.WARNING) | |