Skip to content

Commit

Permalink
fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayballal95 committed Nov 11, 2024
1 parent 7470fd2 commit 69586f5
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions python/python/embed_anything/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"""
from ._embed_anything import *
from .vectordb import *
import platform
import os
import onnxruntime
import glob
Expand All @@ -128,11 +129,19 @@

if path is None:
print("onnxruntime is not installed. Install it using `pip install onnxruntime`")

else:
dylib_path = glob.glob(os.path.join(path, "libonnxruntime.so*"))
os.environ["ORT_DYLIB_PATH"] = dylib_path[0]
if platform.system() == "Windows":
# For Windows, look for DLL files
dylib_path = glob.glob(os.path.join(path, "onnxruntime.dll"))
else:
# For Linux, look for shared object files
dylib_path = glob.glob(os.path.join(path, "libonnxruntime.so*"))

if dylib_path:
os.environ["ORT_DYLIB_PATH"] = dylib_path[0]
else:
print("onnxruntime dynamic library not found.")

__doc__ = _embed_anything.__doc__
if hasattr(_embed_anything, "__all__"):
__all__ = _embed_anything.__all__
__all__ = _embed_anything.__all__

0 comments on commit 69586f5

Please sign in to comment.