See
Emotive Icelandic for more information about this model and the data that it is trained on.
The RepeaTTS series is trained on the same data as Emotive Icelandic, but without emotive content disclosure.
This model, level-1, corresponds to a model without any further refinement fine-tuning.
Use the code below to get started with the model.
1import torch
2from parler_tts import ParlerTTSForConditionalGeneration
3from transformers import AutoTokenizer
4import soundfile as sf
5
6device = "cuda:0" if torch.cuda.is_available() else "cpu"
7
8model = ParlerTTSForConditionalGeneration.from_pretrained("atlithor/RepeaTTS-level-1").to(device)
9tokenizer = AutoTokenizer.from_pretrained("atlithor/EmotiveIcelandic")
10description_tokenizer = AutoTokenizer.from_pretrained(model.config.text_encoder._name_or_path)
11
12prompt = "Þetta er frábær hugmynd!" # E: this is a great idea!
13description = "The recording is of very high quality, with Ingrid's voice sounding clear and very close up."
14
15input_ids = description_tokenizer(description, return_tensors="pt").input_ids.to(device)
16prompt_input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(device)
17
18generation = model.generate(input_ids=input_ids, prompt_input_ids=prompt_input_ids)
19audio_arr = generation.cpu().numpy().squeeze()
20sf.write("ingrid.wav", audio_arr, model.config.sampling_rate)