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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix issues with pytorch 1.13 on MacOs #151

Merged
merged 4 commits into from Dec 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
@@ -1,11 +1,11 @@
default_language_version:
python: python3.8
python: python3

default_stages: [commit, push]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand Down
4 changes: 3 additions & 1 deletion inseq/utils/torch_utils.py
Expand Up @@ -224,6 +224,8 @@ def get_default_device() -> str:
if is_cuda_available() and is_cuda_built():
return "cuda"
elif is_mps_available() and is_mps_built():
return "mps"
# temporarily fix mps-enabled devices on cpu until mps is able to support all operations this package needs
# change this value on your own risk as it might break things depending on the attribution functions used
return "cpu"
else:
return "cpu"