Files
spark-vibevoice/demo/VibeVoice_colab.ipynb
T
2025-08-28 01:28:27 -07:00

4.3 KiB

VibeVoice Colab — T4 Quickstart (1.5B)

This page 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: Use T4

Use T4 in Colab: go to Runtime → Change runtime type → Hardware accelerator: GPU → T4.

In [ ]:
import torch
print(torch.cuda.is_available())
!nvidia-smi

Step 2: Env Install

In [ ]:
!git clone https://github.com/microsoft/VibeVoice.git

import os
os.chdir("./VibeVoice")

!apt update && apt install ffmpeg -y
!pip install -e .

Step 3: Run VibeVoice

In [ ]:
# First download checkpoint takes ~3 minutes
!python demo/inference_from_file.py --model_path microsoft/VibeVoice-1.5B --txt_path demo/text_examples/2p_short.txt --speaker_names Alice Frank

from IPython.display import Audio
Audio("./outputs/2p_short_generated.wav")

TTS from your text

In [ ]:
text = """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."""
with open("demo/text_examples/my_example.txt", "w", encoding="utf-8") as f:
    f.write(text)
In [ ]:
!python demo/inference_from_file.py --model_path microsoft/VibeVoice-1.5B --txt_path demo/text_examples/my_example.txt --speaker_names Alice Frank
Audio("./outputs/my_example_generated.wav")