Files
spark-vibevoice/demo/VibeVoice_colab.ipynb

6.4 KiB

Open In Colab

VibeVoice Colab — T4 Quickstart (1.5B)

This notebook provides a quickstart guide to run VibeVoice on Colab with T4. The T4 GPU can only support the 1.5B model due to memory limitations. Please note that T4 can only use SDPA instead of flash_attention_2, which may result in unstable and lower audio quality. For the best TTS experience, we recommend trying the 7B model on a more powerful GPU.

Step 1: Setup Environment

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")

Step 2: Create Transcript

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.

Step 3: Generate Audio

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")

Step 4: Download Audio

In [ ]:
from google.colab import files
files.download("/content/outputs/my_transcript_generated.wav") 

Risks and Limitations

While efforts have been made to optimize it through various techniques, it may still produce outputs that are unexpected, biased, or inaccurate. VibeVoice inherits any biases, errors, or omissions produced by its base model (specifically, Qwen2.5 1.5b in this release). Potential for Deepfakes and Disinformation: High-quality synthetic speech can be misused to create convincing fake audio content for impersonation, fraud, or spreading disinformation. Users must ensure transcripts are reliable, check content accuracy, and avoid using generated content in misleading ways. Users are expected to use the generated content and to deploy the models in a lawful manner, in full compliance with all applicable laws and regulations in the relevant jurisdictions. It is best practice to disclose the use of AI when sharing AI-generated content.