BuffMcBigHuge / text-generation-webui-edge-tts

A very simple implementation of edge_tts w/ RVC for oobabooga text-generation-webui.
40 stars 2 forks source link

ERROR:Failed to load the extension "edge_tts". [...] ValueError: mutable default <class 'fairseq.dataclass.configs.CommonConfig'> for field common is not allowed: use default_factory #4

Open BlankFX1 opened 10 months ago

BlankFX1 commented 10 months ago
ERROR:Failed to load the extension "edge_tts".
Traceback (most recent call last):
  File "B:\text-generation-webui\modules\extensions.py", line 36, in load_extensions
    exec(f"import extensions.{name}.script")
  File "<string>", line 1, in <module>
  File "B:\text-generation-webui\extensions\edge_tts\script.py", line 24, in <module>
    from fairseq import checkpoint_utils
  File "B:\text-generation-webui\installer_files\env\Lib\site-packages\fairseq\__init__.py", line 20, in <module>
    from fairseq.distributed import utils as distributed_utils
  File "B:\text-generation-webui\installer_files\env\Lib\site-packages\fairseq\distributed\__init__.py", line 7, in <module>
    from .fully_sharded_data_parallel import (
  File "B:\text-generation-webui\installer_files\env\Lib\site-packages\fairseq\distributed\fully_sharded_data_parallel.py", line 10, in <module>
    from fairseq.dataclass.configs import DistributedTrainingConfig
  File "B:\text-generation-webui\installer_files\env\Lib\site-packages\fairseq\dataclass\__init__.py", line 6, in <module>
    from .configs import FairseqDataclass
  File "B:\text-generation-webui\installer_files\env\Lib\site-packages\fairseq\dataclass\configs.py", line 1104, in <module>
    @dataclass
     ^^^^^^^^^
  File "B:\text-generation-webui\installer_files\env\Lib\dataclasses.py", line 1230, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "B:\text-generation-webui\installer_files\env\Lib\dataclasses.py", line 1220, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "B:\text-generation-webui\installer_files\env\Lib\dataclasses.py", line 958, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "B:\text-generation-webui\installer_files\env\Lib\dataclasses.py", line 815, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'fairseq.dataclass.configs.CommonConfig'> for field common is not allowed: use default_factory
BuffMcBigHuge commented 10 months ago

Never seen this issue before. Ensure you install the requirements before running text-generation-webui.

cd text-generation-webui/extensions/edge_tts
pip install -r requirements.txt
hypersniper05 commented 10 months ago

I am having the same issue, fresh install of text generation webui and also installed requirements

2023-11-09 20:50:43 ERROR:Failed to load the extension "edge_tts".
Traceback (most recent call last):
  File "D:\AI\oobabooga_windows\text-generation-webui\modules\extensions.py", line 36, in load_extensions
    exec(f"import extensions.{name}.script")
  File "<string>", line 1, in <module>
  File "D:\AI\oobabooga_windows\text-generation-webui\extensions\edge_tts\script.py", line 24, in <module>
    from fairseq import checkpoint_utils
  File "D:\AI\oobabooga_windows\text-generation-webui\installer_files\env\Lib\site-packages\fairseq\__init__.py", line 20, in <module>
    from fairseq.distributed import utils as distributed_utils
  File "D:\AI\oobabooga_windows\text-generation-webui\installer_files\env\Lib\site-packages\fairseq\distributed\__init__.py", line 7, in <module>
    from .fully_sharded_data_parallel import (
  File "D:\AI\oobabooga_windows\text-generation-webui\installer_files\env\Lib\site-packages\fairseq\distributed\fully_sharded_data_parallel.py", line 10, in <module>
    from fairseq.dataclass.configs import DistributedTrainingConfig
  File "D:\AI\oobabooga_windows\text-generation-webui\installer_files\env\Lib\site-packages\fairseq\dataclass\__init__.py", line 6, in <module>
    from .configs import FairseqDataclass
  File "D:\AI\oobabooga_windows\text-generation-webui\installer_files\env\Lib\site-packages\fairseq\dataclass\configs.py", line 1104, in <module>
    @dataclass
     ^^^^^^^^^
  File "D:\AI\oobabooga_windows\text-generation-webui\installer_files\env\Lib\dataclasses.py", line 1230, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "D:\AI\oobabooga_windows\text-generation-webui\installer_files\env\Lib\dataclasses.py", line 1220, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\AI\oobabooga_windows\text-generation-webui\installer_files\env\Lib\dataclasses.py", line 958, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\AI\oobabooga_windows\text-generation-webui\installer_files\env\Lib\dataclasses.py", line 815, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'fairseq.dataclass.configs.CommonConfig'> for field common is not allowed: use default_factory
kalle07 commented 10 months ago

same issue

last line in intslal requzrement.txt DEPRECATION: omegaconf 2.0.6 has a non-standard dependency specifier PyYAML>=5.1.*. pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of omegaconf or contact the author to suggest that they release a version with a conforming dependency specifiers. Discussion can be found at https://github.com/pypa/pip/issues/12063

if i start web-ui 2023-11-12 22:49:11 ERROR:Failed to load the extension "edge_tts". Traceback (most recent call last): File "e:\text-generation-webui-main\modules\extensions.py", line 36, in load_extensions exec(f"import extensions.{name}.script") File "", line 1, in File "e:\text-generation-webui-main\extensions\edge_tts\script.py", line 24, in from fairseq import checkpoint_utils File "C:\ProgramData\anaconda3\envs\textgen\Lib\site-packages\fairseq__init__.py", line 20, in from fairseq.distributed import utils as distributed_utils File "C:\ProgramData\anaconda3\envs\textgen\Lib\site-packages\fairseq\distributed__init.py", line 7, in from .fully_sharded_data_parallel import ( File "C:\ProgramData\anaconda3\envs\textgen\Lib\site-packages\fairseq\distributed\fully_sharded_data_parallel.py", line 10, in from fairseq.dataclass.configs import DistributedTrainingConfig File "C:\ProgramData\anaconda3\envs\textgen\Lib\site-packages\fairseq\dataclass\init__.py", line 6, in from .configs import FairseqDataclass File "C:\ProgramData\anaconda3\envs\textgen\Lib\site-packages\fairseq\dataclass\configs.py", line 1104, in @dataclass ^^^^^^^^^ File "C:\ProgramData\anaconda3\envs\textgen\Lib\dataclasses.py", line 1230, in dataclass return wrap(cls) ^^^^^^^^^ File "C:\ProgramData\anaconda3\envs\textgen\Lib\dataclasses.py", line 1220, in wrap return _process_class(cls, init, repr, eq, order, unsafe_hash, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\envs\textgen\Lib\dataclasses.py", line 958, in _process_class cls_fields.append(_get_field(cls, name, type, kw_only)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\envs\textgen\Lib\dataclasses.py", line 815, in _get_field raise ValueError(f'mutable default {type(f.default)} for field ' ValueError: mutable default <class 'fairseq.dataclass.configs.CommonConfig'> for field common is not allowed: use default_factory

hypersniper05 commented 10 months ago

For now delete the installer_files : text-generation-webui\installer_files

then edit the start_windows.bat , open in notepad press ctrl+f and find python=3.11 and change it to python=3.10.13 then save.

double click the start_windows.bat and let it download all the files again. It should work now.

the issue is python 3.11. I can confirm this will fix it.

kalle07 commented 10 months ago

sry same issue:

(e:\text-generation-webui\installer_files\env) e:\text-generation-webui>python Python 3.10.13 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:24:38) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

2023-11-14 16:39:38 ERROR:Failed to load the extension "edge_tts". Traceback (most recent call last): File "e:\text-generation-webui\modules\extensions.py", line 36, in load_extensions exec(f"import extensions.{name}.script") File "", line 1, in File "e:\text-generation-webui\extensions\edge_tts\script.py", line 24, in from fairseq import checkpoint_utils File "e:\text-generation-webui\installer_files\env\lib\site-packages\fairseq__init.py", line 29, in from fairseq.dataclass.initialize import hydra_init File "e:\text-generation-webui\installer_files\env\lib\site-packages\fairseq\dataclass\initialize.py", line 8, in from hydra.core.config_store import ConfigStore File "e:\text-generation-webui\installer_files\env\lib\site-packages\hydra\init__.py", line 5, in from hydra import utils File "e:\text-generation-webui\installer_files\env\lib\site-packages\hydra\utils.py", line 10, in from hydra._internal.utils import ( File "e:\text-generation-webui\installer_files\env\lib\site-packages\hydra_internal\utils.py", line 16, in from omegaconf._utils import get_ref_type ImportError: cannot import name 'get_ref_type' from 'omegaconf._utils' (e:\text-generation-webui\installer_files\env\lib\site-packages\omegaconf_utils.py) Running on local URL: http://127.0.0.1:7861

hypersniper05 commented 10 months ago

sry same issue:

(e:\text-generation-webui\installer_files\env) e:\text-generation-webui>python Python 3.10.13 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:24:38) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

2023-11-14 16:39:38 ERROR:Failed to load the extension "edge_tts". Traceback (most recent call last): File "e:\text-generation-webui\modules\extensions.py", line 36, in load_extensions exec(f"import extensions.{name}.script") File "", line 1, in File "e:\text-generation-webui\extensions\edge_tts\script.py", line 24, in from fairseq import checkpoint_utils File "e:\text-generation-webui\installer_files\env\lib\site-packages\fairseqinit.py", line 29, in from fairseq.dataclass.initialize import hydra_init File "e:\text-generation-webui\installer_files\env\lib\site-packages\fairseq\dataclass\initialize.py", line 8, in from hydra.core.config_store import ConfigStore File "e:\text-generation-webui\installer_files\env\lib\site-packages\hydrainit.py", line 5, in from hydra import utils File "e:\text-generation-webui\installer_files\env\lib\site-packages\hydra\utils.py", line 10, in from hydra._internal.utils import ( File "e:\text-generation-webui\installer_files\env\lib\site-packages\hydra_internal\utils.py", line 16, in from omegaconf._utils import get_ref_type ImportError: cannot import name 'get_ref_type' from 'omegaconf._utils' (e:\text-generation-webui\installer_files\env\lib\site-packages\omegaconf_utils.py) Running on local URL: http://127.0.0.1:7861

Run cmd_windows.bat with administrator rights type cd extensions enter type cd edge_tts enter type pip install -r requirements.txt enter

it should work now, the package was not installed correctly because of the incompatibility of the modules and 3.11. Let me know if it works

kalle07 commented 10 months ago

THX !!! wooooo it worked , also with RVC models

do you know a software to generate your own rvc ? and can any model make noises and how ?

and may if i can reduce the speed of the voice that would me great

hypersniper05 commented 10 months ago

Actually, I have this one that is from FNAF phone guy, it sounds pretty cool to me. Has this fallout 4 vibe to it: https://drive.google.com/file/d/1S0z24GuwHmBkV5aLlZ4APXOPtFT3wehp/view?usp=sharing

I use this github project for generating RVC and Bark voice clones, its like text generation webui. It's seriously underrated: https://github.com/rsxdalv/tts-generation-webui

For RVC models I typically get them from a discord channel here is the invite link: https://discord.gg/JxaCUmEM

They have a spreadsheet with a bunch of voices : https://docs.google.com/spreadsheets/d/1leF7_c2Qf5iQRVkmOF51ZSynOvEjz8fHqwriX1wUMPw/edit#gid=0

Have fun!

kalle07 commented 10 months ago

omg 24h service ^^

thx , so no noises, like breath or snore or laughing ? and what is the different of the files one pth and one index ?

hypersniper05 commented 10 months ago

omg 24h service ^^

thx , so no noises, like breath or snore or laughing ? and what is the different of the files one pth and one index ?

No problem !

You need bark ai for that, it sounds more natural. I think there's a bark extension for text generation webui but I am not sure if it has rvc included. You might have to create something custom. I suppose you can use some of the code from here however the only downside is that bark takes longer to generate audio since the response has to be sliced in pieces, processed and then stitched back up in audio before you can hear the whole script and not to mention its not consistent at times. Here's the original repo if you want to dig more: https://github.com/suno-ai/bark

if i am not mistaken the index file is part of rvc 2 that goes with the pt files. I am new to voice cloning too and still learning

kalle07 commented 10 months ago

i see, i take look ...

maybe one question for the moment... i start the oobadoge with start_windows , so it dont load the settings.yaml, can i add anywhere "--settings settings.yaml" ?

hypersniper05 commented 10 months ago

i see, i take look ...

maybe one question for the moment... i start the oobadoge with start_windows , so it dont load the settings.yaml, can i add anywhere "--settings settings.yaml" ?

There's a settings-template you can use in the same directory of start_windows. Remove the template part and it will load automatically. You can also load models automatically using the CMD txt file. I would check oobabooga repo for more arguments, they support a bunch.

kalle07 commented 10 months ago

i will take a look

omg, I have noticed that edge_tts must work online ... why ?

hypersniper05 commented 10 months ago

Seems the tts is a Microsoft online service, not sure if we can bypass it

kalle07 commented 10 months ago

it downlaod at least 1mb every time it speaks, and I don't want to know if anything will be uploaded ^^

can you ask if the programmers can proofe it ?

hypersniper05 commented 10 months ago

it downlaod at least 1mb every time it speaks, and I don't want to know if anything will be uploaded ^^

can you ask if the programmers can proofe it ?

@BuffMcBigHuge I am not sure, maybe BuffMcBigHuge knows more.

You can try this bark extension https://github.com/wsippel/bark_tts

Salty4Daddy commented 8 months ago

Sadly, getting the same problems. Running in Py3.10/Admin priviligies didnt helped. Also tried different versions of libraries, also didnt helped. Running newest version of Ooba. Any ideas?

BuffMcBigHuge commented 7 months ago

I may have fixed the issue. It's related to fairseq not being supported with Python 3.11, which is now default in the conda environment that text-generation-webui creates with the start bat/sh files.

I modified the requirements to point to a repo fork of fairseq that supports 3.11.

You may thank Facebook for this. šŸ¤­