Skip to content

Commit

Permalink
[WIP] Fix issues with pytorch 1.13 on MacOs (#151)
Browse files Browse the repository at this point in the history
* temp reverted to torch 1.12.1 and disallowed use of mps device

* upgraded torch to 1.13.1

* fixed new dependencies, added comment about mps disablement
  • Loading branch information
lsickert committed Dec 17, 2022
1 parent 0f840b9 commit a54cb58
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 84 deletions.
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"

0 comments on commit a54cb58

Please sign in to comment.