Enhance batch_confirm_hf_optimized.py to ensure torchcodec is installed before loading the dataset, and update requirements_optimized.txt to include torchcodec. Modify run_optimized_192cores_no_root.sh to install additional audio dependencies and test audio imports.

This commit is contained in:
Alireza
2025-08-02 18:33:31 +03:30
parent ab53369a89
commit 561e8b519c
8 changed files with 479 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
#!/usr/bin/env python3
"""
Test script for audio dependencies
"""
def test_audio_dependencies():
"""Test if all audio dependencies are installed"""
try:
import torchcodec
print("torchcodec: OK")
except ImportError as e:
print(f"torchcodec: FAILED - {e}")
return False
try:
import datasets
print("datasets: OK")
except ImportError as e:
print(f"datasets: FAILED - {e}")
return False
try:
import soundfile
print("soundfile: OK")
except ImportError as e:
print(f"soundfile: FAILED - {e}")
return False
try:
import librosa
print("librosa: OK")
except ImportError as e:
print(f"librosa: FAILED - {e}")
return False
print("All audio dependencies installed successfully")
return True
if __name__ == "__main__":
success = test_audio_dependencies()
if not success:
exit(1)