Downloads · 30 days
13
6% of all-time downloads
ThuraAung1601/speecht5_for_thai_with_ipa_tts_v1
speecht5_for_thai_with_ipa_tts_v1 is a text-to-audio model from ThuraAung1601. Use it for the text-to-audio task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
13
6% of all-time downloads
All-time downloads
224
Public
Parameters
144M
4.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors578 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of microsoft/speecht5_tts on the Edited Thai Common Voice dataset. It achieves the following results on the evaluation set:
from transformers import SpeechT5Processor, SpeechT5ForTextToSpeech
import numpy as np
tts_model = SpeechT5ForTextToSpeech.from_pretrained("ThuraAung1601/speecht5_for_thai_with_ipa_tts_v1")
ipa_processor = SpeechT5Processor.from_pretrained("ThuraAung1601/speecht5_for_thai_with_ipa_tts_v1")
ipa_tokenizer = ipa_processor.tokenizer
ipa_tokenizer.decode(ipa_tokenizer(text)["input_ids"])
loaded_np = np.load("speaker_embedding_304.npy")
speaker_embedding = torch.tensor(loaded_np)
text = "ที่ข้าพเจ้าได้เคยล่วงเกินท่านไว้"
from pythainlp.tokenize import word_tokenize
from pythainlp.transliterate import transliterate
def thai2ipa_dict(text):
result = []
for word in word_tokenize(text):
result.append(transliterate(word).replace(" ", ""))
return "".join(result)
ipa = thai2ipa_dict(text)
model_input = ipa_processor(text=ipa, return_tensors="pt")
spectrogram = tts_model.generate_speech(model_input["input_ids"], speaker_embedding)
from transformers import SpeechT5HifiGan
the_vocoder = SpeechT5HifiGan.from_pretrained("microsoft/speecht5_hifigan")
with torch.no_grad():
speech = the_vocoder(spectrogram)
import soundfile as sf
sf.write("output.wav", speech.numpy(), samplerate=16000)
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.5418 | 0.5601 | 1000 | 0.4969 |
| 0.5335 | 1.1199 | 2000 | 0.4889 |
| 0.5177 | 1.6799 | 3000 | 0.4818 |
| 0.5188 | 2.2397 | 4000 | 0.4800 |
| 0.5067 | 2.7998 | 5000 | 0.4738 |
| 0.5072 | 3.3596 | 6000 | 0.4730 |