| |
| """ |
| 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 |
|
|
| |
| 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.*") |
|
|
| |
| 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 ===") |
|
|
| |
| 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) |
|
|