Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def get_base_dir():
def join_path(*paths):
return os.path.join(get_base_dir(), *paths)

# return the python version as a string like "310" or "311" etc
def get_python_version():
return f"{sys.version_info.major}{sys.version_info.minor}"

def get_version():
# first read from environment variable
Expand Down Expand Up @@ -398,9 +401,9 @@ def run(self):
self.run_command('test')

if self.arch == 'arm':
ext_path = get_base_dir() + "/build/lib.linux-aarch64-cpython-311/"
ext_path = get_base_dir() + f"/build/lib.linux-aarch64-cpython-{get_python_version()}/"
else:
ext_path = get_base_dir() + "/build/lib.linux-x86_64-cpython-311/"
ext_path = get_base_dir() + f"/build/lib.linux-x86_64-cpython-{get_python_version()}/"
if len(ext_path) == 0:
print("Build wheel failed, not found path.")
exit(1)
Expand Down
9 changes: 7 additions & 2 deletions xllm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import importlib.util
import os
import xllm
install_path_x86 = os.path.dirname(xllm.__file__) + "/xllm_export.cpython-311-x86_64-linux-gnu.so"
install_path_arm = os.path.dirname(xllm.__file__) + "/xllm_export.cpython-311-aarch64-linux-gnu.so"
import sys

def get_python_version():
return f"{sys.version_info.major}{sys.version_info.minor}"

install_path_x86 = os.path.dirname(xllm.__file__) + f"/xllm_export.cpython-{get_python_version()}-x86_64-linux-gnu.so"
install_path_arm = os.path.dirname(xllm.__file__) + f"/xllm_export.cpython-{get_python_version()}-aarch64-linux-gnu.so"
if os.path.exists(install_path_x86):
install_path = install_path_x86
elif os.path.exists(install_path_arm):
Expand Down
Loading