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,31 @@
#!/bin/bash
# Fix torchcodec dependency issue
echo "🔧 Fixing torchcodec dependency..."
# Activate virtual environment if it exists
if [ -d ".venv" ]; then
echo "🔧 Activating virtual environment..."
source .venv/bin/activate
fi
# Install torchcodec
echo "📦 Installing torchcodec..."
uv pip install torchcodec>=0.1.0
# Also install other audio-related dependencies
echo "📦 Installing additional audio dependencies..."
uv pip install librosa>=0.10.0
uv pip install ffmpeg-python>=0.2.0
# Test the import
echo "🧪 Testing audio imports..."
python test_audio_deps.py
if [ $? -eq 0 ]; then
echo "🎯 torchcodec dependency fixed!"
echo "💡 You can now run the optimized processing script."
else
echo "❌ Failed to install torchcodec. Please check your system."
fi