Skip to content

Clean up xcodec addition. #40271

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

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

Conversation

ebezzam
Copy link
Contributor

@ebezzam ebezzam commented Aug 19, 2025

What does this PR do?

Clean up recent model addition for X-Codec #38248

@@ -220,7 +220,7 @@ def insert_dates(model_card_list: list[str]):

# If the dates info line does not exist, add it
else:
paper_link = get_paper_link(path=file_path)
paper_link = get_paper_link(model_card=model_card, path=file_path)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixing bad get_paper_link call

@ebezzam ebezzam requested a review from ArthurZucker August 19, 2025 08:27
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very very nice to support more models! Kudos!

Comment on lines 147 to 156
if arch and arch[0] == "WavLMModel":
self.semantic_model_config = WavLMConfig(**semantic_model_config)
elif arch and arch[0] == "HubertModel":
self.semantic_model_config = HubertConfig(**semantic_model_config)
else:
# print warning that defaulting to HubertConfig
logger.warning(
f"Could not determine semantic model type from config architectures. Got {arch}. Defaulting to HubertConfig."
)
self.semantic_model_config = HubertConfig(**semantic_model_config)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoConfig should be used here

Comment on lines 182 to 184
if encoder_channels is None:
encoder_channels = self.semantic_model_config.hidden_size
self.encoder_channels = encoder_channels
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. does the main model really need to know these?
  2. it is not possible for encoder_channels to be != self.semantic_model_config.hidden_size no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's any reason for input_channels, encoder_channels, decoder_channels output_channels to be different from self.semantic_model_config.hidden_size, so I'll remove those!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created new property to conveniently use within modeling

@property
def semantic_hidden_size(self) -> int:
    return self.semantic_model_config.hidden_size

"""

# fmt: off
EXPECTED_OUTPUTS = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use fixtures with a json for this!

Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: auto, dac, xcodec

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.

3 participants