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

Update accelerate dependency version #892

Merged
merged 2 commits into from
Sep 12, 2023

Conversation

rohithkrn
Copy link
Contributor

Update accelerate version to fix -

File "/usr/local/lib/python3.9/dist-packages/peft/utils/other.py", line 24, in <module>                                                                     
    from accelerate.utils import is_npu_available, is_xpu_available                                                                                           
ImportError: cannot import name 'is_npu_available' from 'accelerate.utils' (/usr/local/lib/python3.9/dist-packages/accelerate/utils/__init__.py)   

@BenjaminBossan
Copy link
Member

Thanks for finding this issue and proposing a solution.

I checked and it seems that is_npu_available is already present in accelerate v0.21:

https://github.com/huggingface/accelerate/blob/v0.21.0/src/accelerate/utils/imports.py#L226

In the future, we might want to just copy these small functions into PEFT to avoid having to restrict the version of packages for just a few lines of code.

@rohithkrn
Copy link
Contributor Author

I was on 0.20.3 version of accelerate which does not have is_npu_available() causing this error.

@BenjaminBossan
Copy link
Member

Yes, it was added in 0.21 AFAICT.

@rohithkrn
Copy link
Contributor Author

Should we set the required version > 0.21 ? Or do you have a different solution?

@BenjaminBossan
Copy link
Member

BenjaminBossan commented Sep 4, 2023

>=0.21.0 should be sufficient.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@BenjaminBossan
Copy link
Member

@rohithkrn Would you be so kind to update the version?

@rohithkrn
Copy link
Contributor Author

@BenjaminBossan updated

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Great, thanks!

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@BenjaminBossan BenjaminBossan merged commit 4c611f4 into huggingface:main Sep 12, 2023
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