Skip to content

Commit

Permalink
fix: failed to install onnxruntime package on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Roel Kluin committed Jul 16, 2023
1 parent 9604cd8 commit 87706b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/tagger/interrogator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import io
from hashlib import sha256
import json
from platform import system
from typing import Tuple, List, Dict, Callable
from pandas import read_csv, read_json
from PIL import Image, UnidentifiedImageError
Expand Down Expand Up @@ -438,9 +439,13 @@ def load(self) -> None:
# TODO: remove old package when the environment changes?
from launch import is_installed, run_pip
if not is_installed('onnxruntime'):
if system() == "Darwin":
package_name = "onnxruntime-silicon"
else:
package_name = "onnxruntime-gpu"
package = os.environ.get(
'ONNXRUNTIME_PACKAGE',
'onnxruntime-gpu'
package_name
)

run_pip(f'install {package}', 'onnxruntime')
Expand Down

0 comments on commit 87706b7

Please sign in to comment.