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

Refactor StarCoder2 using modular #34015

Merged
merged 9 commits into from
Nov 21, 2024
Merged

Refactor StarCoder2 using modular #34015

merged 9 commits into from
Nov 21, 2024

Conversation

Cyrilvallez
Copy link
Member

What does this PR do?

Refactor StarCoder2 to remove all the copied-from and use modular instead.

@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.

@Cyrilvallez Cyrilvallez marked this pull request as ready for review November 5, 2024 19:44
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.

Super nice! Just need clarification about magic comment!

new_body.extend(self.update_body(self.original_methods[func_name].body.body, node.body[i + 1 :]))
new_body = self._fix_init_location(new_body)
comment = expr.trailing_whitespace.comment
# If we have a magic comment, do not unravel the call to super and just remove the comment
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's a magic comment ?

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.

Thanks for removing the # no unravel a lot better IMO

utils/modular_model_converter.py Outdated Show resolved Hide resolved
utils/modular_model_converter.py Show resolved Hide resolved
@Cyrilvallez Cyrilvallez merged commit 4e90b99 into main Nov 21, 2024
18 checks passed
@Cyrilvallez Cyrilvallez deleted the modular-starcoder2 branch November 21, 2024 13:52
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
* Create modular_starcoder2.py

* Update modular_starcoder2.py

* update

* finalize modular

* revert # no-unravel

* Add support

* style

* Update modular_model_converter.py

* update docstring
BernardZach pushed a commit to innovationcore/transformers that referenced this pull request Dec 6, 2024
* Create modular_starcoder2.py

* Update modular_starcoder2.py

* update

* finalize modular

* revert # no-unravel

* Add support

* style

* Update modular_model_converter.py

* update docstring
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