Run this model with HF Jobs
Run OpenMOSS-Team/MOSS-TTSD-v1.0 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/OpenMOSS-Team/MOSS-TTSD-v1.0. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OpenMOSS-Team/MOSS-TTSD-v1.0 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use OpenMOSS-Team/MOSS-TTSD-v1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenMOSS-Team/MOSS-TTSD-v1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="OpenMOSS-Team/MOSS-TTSD-v1.0", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OpenMOSS-Team/MOSS-TTSD-v1.0", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
update
Browse filesFiles changed (2)
- README.md+6-3
- processing_moss_tts.py+3-1
88 unmodified lines89909192939430 unmodified lines125126127128129130131132122 unmodified lines25525625725888 unmodified linesimport osfrom pathlib import Pathimport torchimport torchaudiofrom transformers import AutoModel, AutoProcessor30 unmodified lines# --- Load & resample audio ---target_sr = int(processor.model_config.sampling_rate)wav1, sr1 = torchaudio.load(prompt_audio_speaker1)wav2, sr2 = torchaudio.load(prompt_audio_speaker2)if wav1.shape[0] > 1:wav1 = wav1.mean(dim=0, keepdim=True)122 unmodified linesFor closed-source models, annotators are only asked to choose the overall preferred one in each pair, and we compute the win rate accordingly.88 unmodified lines8990919293949530 unmodified lines126127128129130131132133134135122 unmodified lines25825926026188 unmodified linesimport osfrom pathlib import Pathimport torchimport soundfile as sfimport torchaudiofrom transformers import AutoModel, AutoProcessor30 unmodified lines# --- Load & resample audio ---target_sr = int(processor.model_config.sampling_rate)audio1, sr1 = sf.read(prompt_audio_speaker1, dtype="float32", always_2d=True)audio2, sr2 = sf.read(prompt_audio_speaker2, dtype="float32", always_2d=True)wav1 = torch.from_numpy(audio1).transpose(0, 1).contiguous()wav2 = torch.from_numpy(audio2).transpose(0, 1).contiguous()if wav1.shape[0] > 1:wav1 = wav1.mean(dim=0, keepdim=True)122 unmodified linesFor closed-source models, annotators are only asked to choose the overall preferred one in each pair, and we compute the win rate accordingly.
17 unmodified lines181920212223872 unmodified lines89689789889990090190217 unmodified linesfrom dataclasses import dataclassfrom pathlib import Pathimport reimport torchaudiofrom transformers import processing_utils872 unmodified linestarget_sr = int(self.model_config.sampling_rate)wav_list: List[torch.Tensor] = []for wav_path in wav_path_list:wav, sr = torchaudio.load(wav_path)if int(sr) != target_sr:wav = torchaudio.functional.resample(waveform=wav,17 unmodified lines18192021222324872 unmodified lines89789889990090190290390417 unmodified linesfrom dataclasses import dataclassfrom pathlib import Pathimport reimport soundfile as sfimport torchaudiofrom transformers import processing_utils872 unmodified linestarget_sr = int(self.model_config.sampling_rate)wav_list: List[torch.Tensor] = []for wav_path in wav_path_list:audio, sr = sf.read(wav_path, dtype="float32", always_2d=True)wav = torch.from_numpy(audio).transpose(0, 1).contiguous()if int(sr) != target_sr:wav = torchaudio.functional.resample(waveform=wav,
README.md+6-3
processing_moss_tts.py+3-1