Here we use the pretained weights from ArTST and fine-tuned using huggingface implementation of SpeechT5 on Classical Arabic ClArTTS for speech synthesis (text-to-speech).
Run inference via the
Text-to-Speech
(TTS) pipeline. You can access the Arabic SPeechT5 model via the TTS pipeline in just a few lines of code!
from transformers import pipeline
from datasets import load_dataset
import soundfile as sf
synthesiser = pipeline("text-to-speech", "MBZUAI/speecht5_tts_clartts_ar")
embeddings_dataset = load_dataset("herwoww/arabic_xvector_embeddings", split="validation")
speaker_embedding = torch.tensor(embeddings_dataset[105]["speaker_embeddings"]).unsqueeze(0)
# You can replace this embedding with your own as well.
speech = synthesiser("لأنه لا يرى أنه على السفه ثم من بعد ذلك حديث منتشر", forward_params={"speaker_embeddings": speaker_embedding})
# ArTST is trained without diacritics.
sf.write("speech.wav", speech["audio"], samplerate=speech["sampling_rate"])
Run inference via the Transformers modelling code - You can use the processor + generate code to convert text into a mono 16 kHz speech waveform for more fine-grained control.
from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech, SpeechT5HifiGan
from datasets import load_dataset
import torch
import soundfile as sf
from datasets import load_dataset
processor = SpeechT5Processor.from_pretrained("MBZUAI/speecht5_tts_clartts_ar")
model = SpeechT5ForTextToSpeech.from_pretrained("MBZUAI/speecht5_tts_clartts_ar")
vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
inputs = processor(text="لأنه لا يرى أنه على السفه ثم من بعد ذلك حديث منتشر", return_tensors="pt")
# load xvector containing speaker's voice characteristics from a dataset
embeddings_dataset = load_dataset("herwoww/arabic_xvector_embeddings", split="validation")
speaker_embedding = torch.tensor(embeddings_dataset[105]["speaker_embeddings"]).unsqueeze(0)
speech = model.generate_speech(inputs["input_ids"], speaker_embedding, vocoder=vocoder)
sf.write("speech.wav", speech.numpy(), samplerate=16000)
Citation
BibTeX:
@inproceedings{toyin-etal-2023-artst,
title = "{A}r{TST}: {A}rabic Text and Speech Transformer",
author = "Toyin, Hawau and
Djanibekov, Amirbek and
Kulkarni, Ajinkya and
Aldarmaki, Hanan",
editor = "Sawaf, Hassan and
El-Beltagy, Samhaa and
Zaghouani, Wajdi and
Magdy, Walid and
Abdelali, Ahmed and
Tomeh, Nadi and
Abu Farha, Ibrahim and
Habash, Nizar and
Khalifa, Salam and
Keleg, Amr and
Haddad, Hatem and
Zitouni, Imed and
Mrini, Khalil and
Almatham, Rawan",
booktitle = "Proceedings of ArabicNLP 2023",
month = dec,
year = "2023",
address = "Singapore (Hybrid)",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2023.arabicnlp-1.5",
pages = "41--51"
}
@inproceedings{ao-etal-2022-speecht5,
title = {{S}peech{T}5: Unified-Modal Encoder-Decoder Pre-Training for Spoken Language Processing},
author = {Ao, Junyi and Wang, Rui and Zhou, Long and Wang, Chengyi and Ren, Shuo and Wu, Yu and Liu, Shujie and Ko, Tom and Li, Qing and Zhang, Yu and Wei, Zhihua and Qian, Yao and Li, Jinyu and Wei, Furu},
booktitle = {Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
month = {May},
year = {2022},
pages={5723--5738},
}
Runs of MBZUAI speecht5_tts_clartts_ar on huggingface.co
1.7K
Total runs
0
24-hour runs
40
3-day runs
-49
7-day runs
-385
30-day runs
More Information About speecht5_tts_clartts_ar huggingface.co Model
speecht5_tts_clartts_ar huggingface.co is an AI model on huggingface.co that provides speecht5_tts_clartts_ar's model effect (), which can be used instantly with this MBZUAI speecht5_tts_clartts_ar model. huggingface.co supports a free trial of the speecht5_tts_clartts_ar model, and also provides paid use of the speecht5_tts_clartts_ar. Support call speecht5_tts_clartts_ar model through api, including Node.js, Python, http.
speecht5_tts_clartts_ar huggingface.co is an online trial and call api platform, which integrates speecht5_tts_clartts_ar's modeling effects, including api services, and provides a free online trial of speecht5_tts_clartts_ar, you can try speecht5_tts_clartts_ar online for free by clicking the link below.
MBZUAI speecht5_tts_clartts_ar online free url in huggingface.co:
speecht5_tts_clartts_ar is an open source model from GitHub that offers a free installation service, and any user can find speecht5_tts_clartts_ar on GitHub to install. At the same time, huggingface.co provides the effect of speecht5_tts_clartts_ar install, users can directly use speecht5_tts_clartts_ar installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
speecht5_tts_clartts_ar install url in huggingface.co: