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

fix(peft): adapt to latest internal API #757

Merged
merged 4 commits into from
Jan 27, 2025
Merged

fix(peft): adapt to latest internal API #757

merged 4 commits into from
Jan 27, 2025

Conversation

dacorvo
Copy link
Collaborator

@dacorvo dacorvo commented Jan 8, 2025

What does this PR do?

There has been an evolution in the PEFT internal API that is used by optimum-neuron when subclassing the PEFT Trainer.

This pull-request:

  • adapts to the new internal API,
  • sets a minimum PEFT version in optimum-neuron prerequisites,
  • modifies internal checks for PEFT to verify that the version is at least 0.14.0.

@dacorvo dacorvo force-pushed the adapt_latest_peft branch from ba502e6 to ef70c31 Compare January 8, 2025 09:07
@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.

@dacorvo dacorvo force-pushed the adapt_latest_peft branch from ef70c31 to c5c5c6a Compare January 8, 2025 09:11
Copy link
Collaborator

@JingyaHuang JingyaHuang left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +86 to +96
def is_peft_available(min_version: Optional[str] = MIN_PEFT_VERSION) -> bool:
_peft_available = importlib.util.find_spec("peft") is not None
if min_version is not None:
if _peft_available:
import peft

_peft_version = peft.__version__
return version.parse(_peft_version) >= version.parse(min_version)
else:
return False
return _peft_available
Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@dacorvo dacorvo merged commit b83d474 into main Jan 27, 2025
9 of 11 checks passed
@dacorvo dacorvo deleted the adapt_latest_peft branch January 27, 2025 14:25
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.

4 participants