Skip to content
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

Error on english_bert.py in melo/text/english_bert.py when using local bert-base-uncased model. #132

Open
ivanhe123 opened this issue May 11, 2024 · 0 comments

Comments

@ivanhe123
Copy link

ivanhe123 commented May 11, 2024

When I tried to use an downloaded local version of bert-base-uncased, it loaded correctly and I enter the correct path. I cannot download the model using the c ode becuase for some reason the model will time out. The hf repo is at google-bert/bert-base-uncased.
then there is a warning after a >Text split to sentences. log (which is from faster-whisper):

 > Text split to sentences.
Hello, how are you recently?
 > ===========================
  0%|          | 0/1 [00:00<?, ?it/s]
Some weights of the model checkpoint at xxx/melo/text/bert-base-uncased were not used when initializing BertForMaskedLM: ['bert.pooler.dense.bias', 'bert.pooler.dense.weight', 'cls.seq_relationship.bias', 'cls.seq_relationship.weight']
- This IS expected if you are initializing BertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing BertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
  0%|          | 0/1 [00:02<?, ?it/s]
Traceback (most recent call last):
  File "xxx\run_multi_3.py", line 78, in <module>
    model.tts_to_file(text, speaker_id, src_path, speed=speed)
  File "xxx\melo\api.py", line 100, in tts_to_file
    bert, ja_bert, phones, tones, lang_ids = utils.get_text_for_tts_infer(t, language, self.hps, device, self.symbol_to_id)
  File "xxx\melo\utils.py", line 38, in get_text_for_tts_infer
    bert = get_bert(norm_text, word2ph, language_str, device)
  File "xxx\melo\text\__init__.py", line 29, in get_bert
    bert = lang_bert_func_map[language](norm_text, word2ph, device)
  File "xxx\melo\text\english_bert.py", line 30, in get_bert_feature
    assert inputs["input_ids"].shape[-1] == len(word2ph)
AssertionError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant