#!/usr/bin/env python3 """ Test script to check if all imports work correctly """ import sys import os # Add paths current_dir = os.path.dirname(__file__) src_path = os.path.join(current_dir, 'src') examples_path = os.path.join(current_dir, 'examples') if src_path not in sys.path: sys.path.append(src_path) if examples_path not in sys.path: sys.path.append(examples_path) print("๐Ÿงช Testing EmoVoice imports...") print(f"Current directory: {current_dir}") print(f"Source path: {src_path}") print(f"Examples path: {examples_path}") # Test basic imports try: import numpy as np print("โœ… numpy imported successfully") except ImportError as e: print(f"โŒ numpy import failed: {e}") try: import torch print("โœ… torch imported successfully") except ImportError as e: print(f"โŒ torch import failed: {e}") try: import soundfile as sf print("โœ… soundfile imported successfully") except ImportError as e: print(f"โŒ soundfile import failed: {e}") # Test SLAM-LLM imports try: from slam_llm.utils.model_utils import get_custom_model_factory print("โœ… slam_llm.utils.model_utils imported successfully") except ImportError as e: print(f"โŒ slam_llm.utils.model_utils import failed: {e}") try: from slam_llm.utils.dataset_utils import get_preprocessed_dataset print("โœ… slam_llm.utils.dataset_utils imported successfully") except ImportError as e: print(f"โŒ slam_llm.utils.dataset_utils import failed: {e}") try: from examples.tts.utils.codec_utils import audio_decode_cosyvoice print("โœ… examples.tts.utils.codec_utils imported successfully") except ImportError as e: print(f"โŒ examples.tts.utils.codec_utils import failed: {e}") try: from examples.tts.tts_config import ModelConfig, TrainConfig, DataConfig, DecodeConfig print("โœ… examples.tts.tts_config imported successfully") except ImportError as e: print(f"โŒ examples.tts.tts_config import failed: {e}") # Test Hugging Face imports try: from huggingface_hub import hf_hub_download print("โœ… huggingface_hub imported successfully") except ImportError as e: print(f"โŒ huggingface_hub import failed: {e}") print("\n๐ŸŽฏ Import test completed!")