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,33 @@
#!/bin/bash
# Install torchcodec and run optimized processing
echo "🔧 Installing torchcodec and running optimized processing..."
# Activate virtual environment if it exists
if [ -d ".venv" ]; then
echo "🔧 Activating virtual environment..."
source .venv/bin/activate
fi
# Install torchcodec first
echo "📦 Installing torchcodec..."
uv pip install torchcodec>=0.1.0
# Also install other audio dependencies
echo "📦 Installing additional audio dependencies..."
uv pip install librosa>=0.10.0
uv pip install ffmpeg-python>=0.2.0
# Test the installation
echo "🧪 Testing torchcodec installation..."
python -c "import torchcodec; print('torchcodec installed successfully')"
if [ $? -ne 0 ]; then
echo "❌ Failed to install torchcodec. Trying alternative installation..."
uv pip install --force-reinstall torchcodec>=0.1.0
fi
# Run the optimized processing
echo "🚀 Running optimized processing..."
python batch_confirm_hf_optimized.py