- avoid stateful working-directory changes in notebook cells - use explicit /content/... paths for clone/install/inference - improves readability and re-run reliability
5.8 KiB
5.8 KiB
In [ ]:
# Check for T4 GPU
import torch
if torch.cuda.is_available() and "T4" in torch.cuda.get_device_name(0):
print("✅ T4 GPU detected")
else:
print("""
⚠️ WARNING: T4 GPU not detected
The recommended runtime for this Colab notebook is "T4 GPU".
To change the runtime type:
1. Click on "Runtime" in the top navigation menu
2. Click on "Change runtime type"
3. Select "T4 GPU"
4. Click "OK" if a "Disconnect and delete runtime" window appears
5. Click on "Save"
""")
# Clone the VibeVoice repository
![ -d /content/VibeVoice ] || git clone --quiet --branch main --depth 1 https://github.com/microsoft/VibeVoice.git /content/VibeVoice
print("✅ Cloned VibeVoice repository")
# Install project dependencies
!uv pip --quiet install --system -e /content/VibeVoice
print("✅ Installed dependencies")
# Download model (~3 minutes)
!HF_XET_HIGH_PERFORMANCE=1 hf download microsoft/VibeVoice-1.5B --quiet --local-dir /content/models/VibeVoice-1.5B > /dev/null
print("✅ Downloaded model: microsoft/VibeVoice-1.5B")
In [ ]:
%%writefile /content/my_transcript.txt
Speaker 1: Can I try VibeVoice with my own example?
Speaker 2: Of course! VibeVoice is open-source, built to benefit everyone - you're welcome to try it out.
In [ ]:
# Run Python script to generate audio from transcript
!python /content/VibeVoice/demo/inference_from_file.py \
--model_path /content/models/VibeVoice-1.5B \
--txt_path /content/my_transcript.txt \
--speaker_names Alice Frank
# Display audio controls
from IPython.display import Audio
Audio("/content/outputs/my_transcript_generated.wav")