The VideoAnnotator project uses PyAnnote for speaker diarization, which requires a HuggingFace token.
- Go to HuggingFace Settings
- Create a new token with "Read" permissions
- Accept the terms for pyannote/speaker-diarization-3.1
-
Copy the example environment file:
cp .env.example .env
-
Edit
.envand add your token:# HuggingFace Authentication Token HF_AUTH_TOKEN=hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Set the environment variable in your shell:
Windows (PowerShell):
$env:HF_AUTH_TOKEN="hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Windows (Command Prompt):
set HF_AUTH_TOKEN=hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxLinux/macOS:
export HF_AUTH_TOKEN=hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxRun the diarization test script:
python test_diarization.pyIf configured correctly, you should see:
=== Testing PyAnnote Diarization Pipeline ===
1. Checking Prerequisites:
FFmpeg available: True
HuggingFace token: ✓ Found
- Never commit your
.envfile - it's already in.gitignore - Use the
.env.examplefile as a template for team members - Keep your HuggingFace token secure and don't share it publicly
- Rotate your token periodically for security
"HuggingFace token: ✗ Not found"
- Check that your
.envfile exists in the project root - Verify the token is set as
HF_AUTH_TOKEN=your_token_here - Ensure no extra spaces around the equals sign
"Authentication failed"
- Verify your token is valid at HuggingFace Settings
- Make sure you've accepted the terms for pyannote/speaker-diarization-3.1
- Try regenerating your token if it's old
"Model access denied"
- Go to pyannote/speaker-diarization-3.1
- Click "Agree and access repository"
- Wait a few minutes for permissions to propagate