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

Fixed compatibility to load checkpoint trained by original GPT_SoVITS repo, added .gitignore and removed *.pyc files #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BXYMartin
Copy link

I was trying to load some checkpoints I trained from original repo but got an error with traceback

  File "/home/bxymartin/Documents/Projects/ComfyUI/custom_nodes/ComfyUI-GPT_SoVITS/nodes.py", line 103, in get_tts_wav                                                                                             
    get_tts_wav(renfer_audio,prompt_text,prompt_language,                                                                                                                                                          
  File "/home/bxymartin/Documents/Projects/ComfyUI/custom_nodes/ComfyUI-GPT_SoVITS/inference.py", line 122, in get_tts_wav                                                                                         
    vq_model, hps = change_sovits_weights(sovits_weight)                                                                                                                                                           
  File "/home/bxymartin/Documents/Projects/ComfyUI/custom_nodes/ComfyUI-GPT_SoVITS/inference.py", line 78, in change_sovits_weights                                                                                
    dict_s2 = torch.load(sovits_path, map_location="cpu")                                                                                                                                                            File "/home/bxymartin/.pyenv/versions/3.10.10/lib/python3.10/site-packages/torch/serialization.py", line 1025, in load                                                                                           
    return _load(opened_zipfile,                                                                                                                                                                                   
  File "/home/bxymartin/.pyenv/versions/3.10.10/lib/python3.10/site-packages/torch/serialization.py", line 1447, in _load                                                                                          
    result = unpickler.load()                                                                                                                                                                                      
  File "/home/bxymartin/.pyenv/versions/3.10.10/lib/python3.10/site-packages/torch/serialization.py", line 1440, in find_class                                                                                     
    return super().find_class(mod_name, name)
AttributeError: Can't get attribute 'HParams' on <module 'utils' from '/home/bxymartin/Documents/Projects/ComfyUI/comfy/utils.py'>

This is because we have moved the original modules inside the folder and we are having a conflict with comfy/utils.py from ComfyUI and failed to locate the one in GPT_SoVITS/utils.py where it has the definition for HParams module. A simple fix would be to patch the utils entry in sys.module and revert it afterwards.

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

Successfully merging this pull request may close these issues.

1 participant