-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Awesome in english but no support for other languages - please add an example for another language (german, italian, french etc) #41
Comments
The repo so far is a research project and its main purpose serves more as a proof of concept for the paper than a full-fledged open source project. I agree that PL-BERT is the major obstacle to generalize to other languages, but training large-scale language models particularly on multiple languages can be very challenging. With the resources I have in the school, training PL-BERT on English only corpus with 3 A40 took me a month, with all the ablation studies and experiment, I spent an entire summer on this project only for a single language. I'm not affiliated with any company and I'm only a PhD student, and the GPU resources in our lab need to be prioritized for new research projects. I don't think I will have resources to train a multi-lingual PL-BERT model at the time being, so PL-BERT probably is not the best approach to multilingual models for StyleTTS 2. I have never tried XPhoneBERT myself, but it seems to be a promising alternative PL-BERT. The only problem of it is that it uses a different phonemizer, which can also be related to #40 . The current phonemizer was taken from VITS, which also incurs license issues (MIT vs. GPL). It would be great if someone could help to switch the phoneimzer and BERT model to things like XPhoneBERT that is compatible with MIT license and also supports multiple languages. The basic idea is to re-train the ASR model (https://github.com/yl4579/AuxiliaryASR) using the phonemizer of XPhoneBERT, and replace PL-BERT with XPhoneBERT and re-train the model from scratch. Since the models, especially the model LibriTTS, took about 2 weeks to train on 4 A100, I do not think I have enough GPU resources to work on this for the time being. If anyone is willing to sponsor GPUs and datasets for either multilingual PL-BERT or XPhoneBERT StyleTTS 2, I'm happy to extend this project towards the multilingual directions. |
I think it would be doable to get the GPU time, 1 week of 8xA100 maybe in exchange of naming the resulting model after the sponsor. One of the cloud providers might be interested, or some guys from the ML discords who train a lot might have it spare. Datasets: Italian: TTS dataset, LJSpeech affiliated ? Multilingual: Sidenote: For detecing unclean audio, possibly "CLAP" from Laion could be used. |
Multilingual speech datasets are more difficult to get than language datasets. XPhoneBERT for example was trained entirely on Wikipedia in 100+ languages, but getting 100+ languages of speech data with transcriptions is more difficult. XTTS has multilingual supports but the data used seems private. I believe the creator @erogol was once interested in StyleTTS but did not proceed to integrate this into Coqui API for some reason. It would be great if he could help for multilingual supports. I will ping him to see if he is still interested. |
I found quite good datasets for Italian and German, will take another look for more. Will update the previous comment. |
If you want cross-lingual generalization, I think each language should be at least 100 hours. The data you provide probably is good for a single speaker model, but not enough for zero-shot models like XTTS. It is not feasible to get a model like that with publicly available data. We probably have to rely on something like multilingual librispeech (https://www.openslr.org/94/) and use some speech restoration models to remove bad samples. This is not a single person's effort, so everyone else is welcome to contribute. |
It's a pity not supporting Chinese. |
I can make a 8x 3090 (24GB) machine available, if it's of use. 2x Xeon E5-2698 v3 cpus, 128GB ram. Alternatively: a 4x 3090 box with nvlinks, Epyc 7443p, 256GB, pcie 4.0. Send a mail to [email protected] |
I can support for training turkish model, just need a help for training pl-bert for turkish wikipedia dataset. |
@hobodrifterdavid Thanks so much for your help. What you have now is probably good for multilingual PL-BERT training as long as you can keep this machine running for at least a couple of months or so. Just sent you an email for multilingual PL-BERT training. |
I think the GPUs provided by @hobodrifterdavid would be a great start for multilingual PL-BERT training. Before proceeding though, I need some people who speak as many languages as possible (hopefully also have some knowledge in IPA) to help with the data preparation. I only speak English, Chinese and Japanese, so I can only help with these 3 languages. My plan is to use this multilingual BERT tokenizer: https://huggingface.co/bert-base-multilingual-cased, tokenize the text, get the corresponding tokens, use phonemizer to get the corresponding phonemes, and align the phonemes with tokens. Since this tokenizer is subword, we cannot predict the subword grapheme tokens. So my idea is instead of predicting the grapheme tokens (which is not a full grapheme anyway, and we cannot really align half of a grapheme to some of its phonemes, like in English "phonemes" can be tokenized into For example, for the sentence "This is a test sentence", we get 5 tokens Now the biggest challenge is aligning the tokenizer output to the graphemes, which may require some expertise in the specific languages. There could be potential quirks, inaccuracy or traps for certain languages. For example, phonemizer doesn't work with Japanese and Chinese directly, you have to first phonemize the grapheme into alphabets and then use phonemizer. The characters in these languages do not always have the same pronunciations depending on the context, so expertise in these languages is needed when doing NLP with them. To make sure the data preprocessing goes as smooth and accurate as possible, any help from those who speaks any language in this list (or knows some linguistics about these languages) is greatly appreciated. |
I can speak Persian, Japanese and a little bit of Arabic. (Have a friend fleunt in this as well). I would very much like to help you with this. |
@SoshyHayami Thanks for your willingness to help. Fortunately, I think most other languages that have whitespaces between words can be handled with the same logic. The only supported languages that do not have space between them are Chinese, Japanese (including Korean Hanja rarely), and Burmese. These are probably languages that need to be handled with their own logics. I can handle the first two languages, and we just need someone to handle the other two (Korean Hanja and Burmese). |
It would be great if it could support Chinese language! I am a native Chinese, and I don't know what help I can provide? |
Maybe I’ll create a new branch in the PL-BERT repo for multilingual processing scripts. Chinese and Japanese definitely needs to be processed separately with their own logics. @mzdk100 If you have some good Chinese phonemizer (Chinese characters to pinyin), you are welcome to contribute. |
in the case of Japanese, since it already has Kana which is basically an alphabet, can't we simply restrict it to just that for now?(Kana and Romaji should be easier to phonemize if I'm not mistaken here.) though It'll probably make inference a torture as well on low-performance devices. |
@yl4579 pip3 install jieba pypinyin from pypinyin import lazy_pinyin, pinyin, Style
print(pinyin('朝阳')) # [['zhāo'], ['yáng']]
print(pinyin('朝阳', heteronym=True)) # [['zhāo', 'cháo'], ['yáng']]
print(pinyin('聪明的小兔子')) # ['cong', 'ming', 'de', 'xiao', 'tu', 'zi']
print(lazy_pinyin('聪明的小兔子', style=Style.TONE3)) # ['cong1', 'ming2', 'de', 'xiao3', 'tu4', 'zi'] There are many Chinese characters, and using pinyin can greatly reduce the number of vocabulary and potentially make the model smaller. import jieba
print(list(jieba.cut('你好,我是中国人'))) # ['你好', ',', '我', '是', '中国', '人']
print(list(jieba.cut_for_search('你好,我是中国人'))) # ['你好', ',', '我', '是', '中国', '人'] If using word segmentation mode, the model can learn more natural language features, but the Chinese vocabulary is very large, and perhaps the model will be super large, and the computational power requirements are unimaginable. print(' '.join(lazy_pinyin('聪明的小兔子', style=Style.TONE3))) # 'cong1 ming2 de xiao3 tu4 zi' |
If german ears are needed, I'd be happy to lend |
https://github.com/rime/rime-terra-pinyin/blob/master/terra_pinyin.dict.yaml From the industrial world, this is the characters-to-pinyin solution that the well-known input method editor Rime uses. |
keen to extend this to malayalam, dravidian language spoken in south india. will help for that. |
I hope Cantonese or Traditional Chinese is also considered when training the multilingual system, I can definitely help regarding this language. Is there any cooperation channel for this task? |
Personally, I do not support Coqui TTS. XTTS is not open-sourced according to OSI because of its ultra-restrictive license. I believe that the future of TTS lies in open-source models such as StyleTTS. |
@rjrobben I have created a slack channel for this multilingual PL-BERT: https://join.slack.com/t/multilingualstyletts2/shared_invite/zt-2805io6cg-0ROMhjfW9Gd_ix_FJqjGmQ |
Also yl4579/PL-BERT#22 this maybe helpful, if anyone could try it out. |
@yl4579 Thanks for making the slack channel! Are you planning to make a slack channel for general StyleTTS 2-related discussions as well? Just because GH Discussions isn't realtime? |
@fakerybakery I can make this channel generally StyleTTS2-related if it is better. I can change the title to StyleTTS 2 instead. |
Great, thanks! Maybe make one chatroom just about BERT instead? |
Yeah I've already done that. There's a channel about multilingual PLBERT. |
Please add hindi support as well |
@somerandomguyontheweb You can join the slack channel and make the dataset yourself if you believe the espeak is bad. I will upload all the dataset I have soon. |
@iamjamilkhan @GayatriVadaparty Hindi and Telugu are already added in multilingual PL-BERT training. I will upload the dataset soon. You can check the quality and let me know if something needs to be fixed. |
@yl4579 Sure, I’ll do that. |
I have uploaded most of the data I have: https://huggingface.co/datasets/styletts2-community/multilingual-pl-bert |
Please add Marathi support as well |
@SanketDhuri It is already included: https://huggingface.co/datasets/styletts2-community/multilingual-pl-bert/tree/main/mr |
@yl4579 Did you start the training? I may can help in Spanish (Spain) if needed. |
I am here to help with French if needed ! |
My last status: Training of ML-PL-Bert is planned to start during January (did not start yet) |
Hello. I'm interested in helping train a PT-BR model. I have corporate resources to do so. Let me know how I can help. |
I'd love to see support for German accents like Austrian but I guess there's no dataset available. |
I could give linguistic support in most Iberian languages: Castilian Spanish, Basque, Catalan, Asturian and Galician. |
hello! also interested in adding support for the oromo (orm) language, espeak-ng has a phonemizer for it although it could be improved upon. |
Any chances to include Bulgarian? |
Hi everyone -- I have trained a PL-BERT model on a 14 language dataset which was crowdsourced by the author of the paper. You can find this model open-sourced here: https://huggingface.co/papercup-ai/multilingual-pl-bert Using this PL-BERT model, you can now train multilingual StyleTTS2 models. In my experiments, I have found that you don't need to train from scratch in order to train multilingual StyleTTS2, you can just finetune. Follow the steps outlined in the link I shared above! Best of luck, and let me know what you make with this! |
This is awesome. Unfortunately it seems we got no language embeddings so that we could really train a multilingual model with cross-lingual capabilities atm? |
I have actually trained a model which can speak multiple languages, without the need of a language embedding. I guess the model learns implicitly, either based on the phonemisation, or based on the references, to speak with a specific accent |
@rlenain interesting, yeah I assume this would work, just a little bit uncomfortable to rely on it doing the right thing when you want one voice in multiple languages. I thought maybe I could additively augment the style embedding with some language Infos. |
I am a native Bengali speaker from India. Please let me what kind of help I can offer. |
@rlenain, thank you for your awesome work! |
You need to further finetune or train from scratch with PL-BERT. It won't work in inference mode only. That's because if you change it, then the outputs of the PL-BERT module will not be "aligned" with other modules that expect the PL-BERT outputs as inputs. This is generally true with any ML model -- if you change a module, then you need to further train / finetune to be able to get the model to work. |
I tried finetuning in German using around 1h of data and using the multilingual BERT, but even training for 50 epochs did not yield a model that could generate coherent text. The only parameters I changed in the config_ft.yaml were: diff_epoch and joint_epoch: tried different values, but also used the standard 10 and 30. What I find curious is that the generated speech regarding tonality and inflection sounds close to the reference, but the content is just gibberish. I thought it might be the data, but maybe someone with a little more experience in fine-tuning can tell me if this might be an issue that isn't data-related? Also, general question: I am unsure if I need the original LibriTTS Dataset in the data folder for fine-tuning? Because the OOD_texts .txt points to nonexisting files and the way the fine-tune tutorial is written it is not clear if we just need the OOD_texts file or the files it points to as well. Edit: So after playing around some more I decided to make my own OOD_texts file, and now at least the sentences the model generates are understandable as German. Still, the generation quality is not very high, even using 50 epochs to train. I have around 1h of audio, is this still too little? |
Hello) Let's make it easier:
|
Suggestions can refer to gpt-so-vits This open-source implementation method for TTS in multiple languages is really great, and it can be said that it is the best Chinese TTS, including Japanese, English, and Korean. |
@LordSyd what are the steps you took? I have several hours of video of myself in Spanish, and I could prepare a dataset using Whisper to transcribe, however I’m not sure what do I have to do. I have a 4090, I can try the fine tuning with way more than 1 hour of data, but some help to know the steps is welcome, I have no idea :) |
@LordSyd |
Me too! |
The readme makes it sound very simple: "Replace bert with xphonebert"
Looking a bit closer looks like it's quite a feat to make StyleTTS2 talk in non-english languages (#28)
StyleTTS2 looks like the best approach we have right now, but only english is a killer for many as it means any app will be limited to english without prospect for other users in sight.
Some help to get this going in foreign languages would be awesome.
It appears we need to change inference code and re-train text and phonetics. Any demo/guide would be great
Alternatively re-training the current PL-Bert for other languages, though that needs a corpus and I've no idea on the cost ?
(https://github.com/yl4579/PL-BERT)
The text was updated successfully, but these errors were encountered: