Download test_warnings.py from manbeast3b/alien-ifevr3-optim3_hg16: direct link, hf CLI and curl.
- Browser
- Download file 2.06 kB
-
https://huggingface.co/manbeast3b/alien-ifevr3-optim3_hg16/resolve/main/test_warnings.py
- Command line
-
hf download hf://manbeast3b/alien-ifevr3-optim3_hg16/test_warnings.py
-
curl -L -o test_warnings.py https://huggingface.co/manbeast3b/alien-ifevr3-optim3_hg16/resolve/main/test_warnings.py
2.06 kB
| #!/usr/bin/env python3 | |
| """ | |
| Test script to verify warning suppression is working. | |
| This script imports the same libraries as server.py to test warning behavior. | |
| """ | |
| import warnings | |
| import os | |
| # Apply the same warning suppression as server.py | |
| warnings.filterwarnings("ignore", category=UserWarning, module="pygame.*") | |
| warnings.filterwarnings("ignore", category=FutureWarning, module="torch.*") | |
| warnings.filterwarnings("ignore", category=FutureWarning, module="audiotools.*") | |
| warnings.filterwarnings("ignore", message=".*pkg_resources is deprecated.*") | |
| warnings.filterwarnings("ignore", message=".*torch\\.load.*weights_only.*") | |
| warnings.filterwarnings("ignore", message=".*torch\\.nn\\.utils\\.weight_norm.*deprecated.*") | |
| # Suppress common ML library warnings | |
| warnings.filterwarnings("ignore", category=UserWarning, module="transformers.*") | |
| warnings.filterwarnings("ignore", category=UserWarning, module="whisper.*") | |
| warnings.filterwarnings("ignore", category=UserWarning, module="librosa.*") | |
| print("=== TESTING WARNING SUPPRESSION ===") | |
| # Test imports that would normally generate warnings | |
| print("1. Testing pygame/librosa import...") | |
| try: | |
| import librosa | |
| print(" ✓ librosa imported without warnings") | |
| except Exception as e: | |
| print(f" ⚠ librosa import issue: {e}") | |
| print("2. Testing torch import...") | |
| try: | |
| import torch | |
| print(" ✓ torch imported without warnings") | |
| except Exception as e: | |
| print(f" ⚠ torch import issue: {e}") | |
| print("3. Testing transformers import...") | |
| try: | |
| from transformers import AutoTokenizer | |
| print(" ✓ transformers imported without warnings") | |
| except Exception as e: | |
| print(f" ⚠ transformers import issue: {e}") | |
| print("4. Testing outetts import...") | |
| try: | |
| import outetts | |
| print(" ✓ outetts imported without warnings") | |
| except Exception as e: | |
| print(f" ⚠ outetts import issue: {e}") | |
| print("\n=== TEST COMPLETE ===") | |
| print("If you see this message without the warnings from your original output,") | |
| print("then warning suppression is working correctly!") | |
| print("=" * 50) | |