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 when initializing model: AttributeError: can't set attribute 'frame_rate' #164

Open
oliverkinch opened this issue Nov 5, 2024 · 2 comments

Comments

@oliverkinch
Copy link

Running:

python helpers/model_init_scripts/init_model_600M.py ./parler-tts-untrained-600M --text_model "google/flan-t5-large" --audio_model "parler-tts/dac_44khZ_8kbps"

I get the following trace:

Traceback (most recent call last):
  File "/home/ubuntu/parler-tts/helpers/model_init_scripts/init_model_600M.py", line 21, in <module>
    encodec = AutoModel.from_pretrained(encodec_version)
  File "/home/ubuntu/parler-tts/.venv/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 526, in from_pretrained
    config, kwargs = AutoConfig.from_pretrained(
  File "/home/ubuntu/parler-tts/.venv/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 1041, in from_pretrained
    return config_class.from_dict(config_dict, **unused_kwargs)
  File "/home/ubuntu/parler-tts/.venv/lib/python3.10/site-packages/transformers/configuration_utils.py", line 718, in from_dict
    config = cls(**config_dict)
  File "/home/ubuntu/parler-tts/.venv/lib/python3.10/site-packages/transformers/models/dac/configuration_dac.py", line 106, in __init__
    super().__init__(**kwargs)
  File "/home/ubuntu/parler-tts/.venv/lib/python3.10/site-packages/transformers/configuration_utils.py", line 318, in __init__
    raise err
  File "/home/ubuntu/parler-tts/.venv/lib/python3.10/site-packages/transformers/configuration_utils.py", line 315, in __init__
    setattr(self, key, value)
  File "/home/ubuntu/parler-tts/.venv/lib/python3.10/site-packages/transformers/configuration_utils.py", line 200, in __setattr__
    super().__setattr__(key, value)
AttributeError: can't set attribute 'frame_rate'
@oliverkinch
Copy link
Author

In DacConfig frame_rate is not an attribute, but a property. frame_rate should thus simply be removed from the config?

@oliverkinch
Copy link
Author

oliverkinch commented Nov 5, 2024

After this hotfix (ignore the "frame_rate" ) I can now initialize a model.

        # Additional attributes without default values
        for key, value in kwargs.items():
            try:
                if key == "frame_rate":
                    continue
                setattr(self, key, value)
            except AttributeError as err:
                logger.error(f"Can't set {key} with value {value} for {self}")
                raise err

The source code

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