SylReg-Distill
Model Details
Model Description
- Language(s) (NLP): English
Model Sources
- Repository: Code
- Paper: arXiv:2607.04064
- Demo: Project page
How to Get Started with the Model
Use the code below to get started with the model.
git clone https://github.com/ryota-komatsu/speaker_disentangled_hubert.git
cd speaker_disentangled_hubert
sudo apt install git-lfs # for UTMOS
conda create -y -n py310 -c pytorch -c conda-forge python=3.10 pip=24.0 setuptools=81.0.0 faiss-gpu=1.13.2 uv sox
conda activate py310
export UV_PROJECT_ENVIRONMENT=$CONDA_PREFIX
uv pip install -r requirements/requirements.txt
sh scripts/setup.sh
import re
import torch
import torchaudio
from datasets import load_dataset
from transformers import AutoModelForCausalLM, AutoTokenizer
from src.flow_matching import FlowMatchingWithBigVGan
from src.s5hubert import SylRegForSyllableDiscovery
# download pretrained models from hugging face hub
encoder = SylRegForSyllableDiscovery.from_pretrained("ryota-komatsu/SylReg-Distill", device_map="cuda", dtype="auto")
decoder = FlowMatchingWithBigVGan.from_pretrained("ryota-komatsu/SylReg-Decoder", device_map="cuda", dtype="auto")
speechlm = AutoModelForCausalLM.from_pretrained("ryota-komatsu/SylReg-LM-7B-Instruct", device_map="cuda", dtype="auto")
tokenizer = AutoTokenizer.from_pretrained("ryota-komatsu/SylReg-LM-7B-Instruct")
# load a waveform
dataset = load_dataset("fixie-ai/llama-questions", split="test")
dataset = dataset.with_format("torch")
input_values, sr = dataset[0]["audio"]["array"].unsqueeze(0), dataset[0]["audio"]["sampling_rate"] # (1, T), int
input_values = torchaudio.functional.resample(input_values, sr, 16000)
# encode a waveform into syllabic units
outputs = encoder(input_values.to(encoder.device))
units = outputs[0]["units"] # [3950, 67, ..., 503]
input_len = len(units)
# speech language modeling
messages = [
{"role": "user", "content": "".join(f"<{unit}>" for unit in units)},
]
input_ids = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt",
).input_ids.to(speechlm.device)
generated_ids = speechlm.generate(input_ids=input_ids, do_sample=True, temperature=0.8)[0]
units = tokenizer.decode(generated_ids)
units = torch.tensor([int(unit) for unit in re.findall(r"<(\d+)>", units)], device=decoder.device)
units = units[input_len:]
# unit-to-speech synthesis
generated_speech = decoder(units.unsqueeze(0)).waveform.cpu() # (1, T)
torchaudio.save("input.wav", input_values, 16000)
torchaudio.save("output.wav", generated_speech, 16000)
Training Details
Training Data
LibriSpeech train-clean-100
Training Hyperparameters
- Training regime: bf16 mixed precision
Hardware
4 x A6000
Citation
BibTeX:
@article{Komatsu_SylReg_2026,
author = {Komatsu, Ryota and Kawakita, Kota and Okamoto, Takuma and Shinozaki, Takahiro},
title = {Speaker-Disentangled Chunk-Wise Regression for Syllabic Tokenization},
year = {2026},
volume = {7},
journal = {IEEE Open Journal of Signal Processing},
pages = {800--808},
}