File tree Expand file tree Collapse file tree 3 files changed +6
-11
lines changed Expand file tree Collapse file tree 3 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
import random
3
- import re
4
3
from contextlib import contextmanager
5
4
from dataclasses import dataclass
6
5
from time import time
@@ -876,16 +875,12 @@ def load_checkpoint(
876
875
vocoder_checkpoint_path = vocoder_checkpoint_path or os .path .join (checkpoint_dir , "vocoder.pth" )
877
876
878
877
if os .path .exists (ar_path ):
879
- keys_to_ignore = self .autoregressive .gpt ._keys_to_ignore_on_load_missing # pylint: disable=protected-access
880
878
# remove keys from the checkpoint that are not in the model
881
879
checkpoint = torch .load (ar_path , map_location = torch .device ("cpu" ))
882
- for key in list (checkpoint .keys ()):
883
- for pat in keys_to_ignore :
884
- if re .search (pat , key ) is not None :
885
- del checkpoint [key ]
886
- break
887
880
888
- self .autoregressive .load_state_dict (checkpoint , strict = strict )
881
+ # strict set False
882
+ # due to removed `bias` and `masked_bias` changes in Transformers
883
+ self .autoregressive .load_state_dict (checkpoint , strict = False )
889
884
890
885
if os .path .exists (diff_path ):
891
886
self .diffusion .load_state_dict (torch .load (diff_path ), strict = strict )
Original file line number Diff line number Diff line change 6
6
7
7
try :
8
8
import MeCab
9
- except ImportError :
10
- raise ImportError ("Japanese requires mecab-python3 and unidic-lite." )
9
+ except ImportError as e :
10
+ raise ImportError ("Japanese requires mecab-python3 and unidic-lite." ) from e
11
11
from num2words import num2words
12
12
13
13
_CONVRULES = [
Original file line number Diff line number Diff line change @@ -12,4 +12,4 @@ def test_synthesize():
12
12
'tts --model_name "coqui_studio/en/Torcull Diarmuid/coqui_studio" '
13
13
'--text "This is it" '
14
14
f'--out_path "{ output_path } "'
15
- )
15
+ )
You can’t perform that action at this time.
0 commit comments