Spaces:
Runtime error
Runtime error
| #!/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!") | |