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:
42
vosk/test_files/test_audio_deps.py
Normal file
42
vosk/test_files/test_audio_deps.py
Normal 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)
|
||||
Reference in New Issue
Block a user