Download setup from bthaile/opteee: direct link, hf CLI and curl.
- Browser
- Download file 2.18 kB
-
https://huggingface.co/spaces/bthaile/opteee/resolve/main/setup
- Command line
-
hf download hf://spaces/bthaile/opteee/setup
-
curl -L -o setup https://huggingface.co/spaces/bthaile/opteee/resolve/main/setup
2.18 kB
| # YouTube Transcript Project Setup Script | |
| # This script configures pyenv and creates the right environment for the project | |
| echo "π¦ Setting up YouTube Transcript Project with pyenv..." | |
| # Check if pyenv is installed | |
| if ! command -v pyenv &> /dev/null; then | |
| echo "β pyenv is not installed. Please install pyenv first:" | |
| echo " For macOS: brew install pyenv" | |
| echo " For Linux: curl https://pyenv.run | bash" | |
| exit 1 | |
| fi | |
| # Install Python 3.11.7 if not already installed | |
| if ! pyenv versions | grep -q "3.11.7"; then | |
| echo "π Installing Python 3.11.7 with pyenv..." | |
| pyenv install 3.11.7 | |
| else | |
| echo " Python 3.11.7 is already installed" | |
| fi | |
| # Set local Python version for this project | |
| echo "π Setting local Python version to 3.11.7..." | |
| pyenv local 3.11.7 | |
| # Check if we have a virtual environment | |
| if [ ! -d "venv" ]; then | |
| echo "π Creating a new virtual environment..." | |
| python -m venv venv | |
| else | |
| echo " Virtual environment already exists" | |
| fi | |
| # Activate the virtual environment | |
| echo "π Activating virtual environment..." | |
| source venv/bin/activate | |
| # Upgrade pip | |
| echo "π Upgrading pip..." | |
| pip install --upgrade pip | |
| # Install requirements | |
| echo "π Installing requirements..." | |
| pip install -r requirements.txt | |
| # Create transcripts directory if it doesn't exist | |
| if [ ! -d "transcripts" ]; then | |
| echo "π Creating transcripts directory..." | |
| mkdir -p transcripts | |
| fi | |
| # Create empty progress file if it doesn't exist | |
| if [ ! -f "transcript_progress.json" ]; then | |
| echo "π Creating empty progress file..." | |
| echo '{ | |
| "processed": [], | |
| "failed": [], | |
| "whisper_processed": [] | |
| }' > transcript_progress.json | |
| echo "β οΈ Note: Created a new empty progress file. If you have a backup, replace it with your original." | |
| else | |
| echo " Progress file already exists" | |
| fi | |
| echo " Setup complete! You can now run:" | |
| echo " source venv/bin/activate # To activate the environment" | |
| echo " python whisper_transcribe.py # To run the transcription script" | |
| echo "" | |
| echo "β οΈ IMPORTANT: Always backup your transcript_progress.json file" | |
| echo " when recreating the project to preserve your download history." |