add some env in ci
This commit is contained in:
6
.github/workflows/build-reusable.yml
vendored
6
.github/workflows/build-reusable.yml
vendored
@@ -204,7 +204,7 @@ jobs:
|
|||||||
# Create a virtual environment
|
# Create a virtual environment
|
||||||
uv venv
|
uv venv
|
||||||
source .venv/bin/activate || source .venv/Scripts/activate
|
source .venv/bin/activate || source .venv/Scripts/activate
|
||||||
|
|
||||||
# Install the built wheels
|
# Install the built wheels
|
||||||
if [[ "${{ matrix.os }}" == ubuntu-* ]]; then
|
if [[ "${{ matrix.os }}" == ubuntu-* ]]; then
|
||||||
uv pip install packages/leann-core/dist/*.whl
|
uv pip install packages/leann-core/dist/*.whl
|
||||||
@@ -226,7 +226,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
# Activate virtual environment
|
# Activate virtual environment
|
||||||
source .venv/bin/activate || source .venv/Scripts/activate
|
source .venv/bin/activate || source .venv/Scripts/activate
|
||||||
|
|
||||||
# Run all tests
|
# Run all tests
|
||||||
pytest tests/
|
pytest tests/
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
# Activate virtual environment
|
# Activate virtual environment
|
||||||
source .venv/bin/activate || source .venv/Scripts/activate
|
source .venv/bin/activate || source .venv/Scripts/activate
|
||||||
|
|
||||||
# Run distance function tests if available
|
# Run distance function tests if available
|
||||||
if [ -f test/sanity_checks/test_distance_functions.py ]; then
|
if [ -f test/sanity_checks/test_distance_functions.py ]; then
|
||||||
echo "Running distance function sanity checks..."
|
echo "Running distance function sanity checks..."
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -86,3 +86,5 @@ packages/leann-backend-diskann/third_party/DiskANN/_deps/
|
|||||||
*.passages.json
|
*.passages.json
|
||||||
|
|
||||||
batchtest.py
|
batchtest.py
|
||||||
|
tests/__pytest_cache__/
|
||||||
|
tests/__pycache__/
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ if(APPLE)
|
|||||||
set(OpenMP_C_LIB_NAMES "omp")
|
set(OpenMP_C_LIB_NAMES "omp")
|
||||||
set(OpenMP_CXX_LIB_NAMES "omp")
|
set(OpenMP_CXX_LIB_NAMES "omp")
|
||||||
set(OpenMP_omp_LIBRARY "/opt/homebrew/opt/libomp/lib/libomp.dylib")
|
set(OpenMP_omp_LIBRARY "/opt/homebrew/opt/libomp/lib/libomp.dylib")
|
||||||
|
|
||||||
# Force use of system libc++ to avoid version mismatch
|
# Force use of system libc++ to avoid version mismatch
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++")
|
||||||
|
|
||||||
# Set minimum macOS version for better compatibility
|
# Set minimum macOS version for better compatibility
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum macOS version")
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum macOS version")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ if platform.system() == "Darwin":
|
|||||||
os.environ["MKL_NUM_THREADS"] = "1"
|
os.environ["MKL_NUM_THREADS"] = "1"
|
||||||
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
|
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"
|
||||||
os.environ["KMP_BLOCKTIME"] = "0"
|
os.environ["KMP_BLOCKTIME"] = "0"
|
||||||
|
# Additional fixes for PyTorch/sentence-transformers on macOS ARM64 only in CI
|
||||||
|
if os.environ.get("CI") == "true":
|
||||||
|
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "0"
|
||||||
|
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
||||||
|
|
||||||
from .api import LeannBuilder, LeannChat, LeannSearcher
|
from .api import LeannBuilder, LeannChat, LeannSearcher
|
||||||
from .registry import BACKEND_REGISTRY, autodiscover_backends
|
from .registry import BACKEND_REGISTRY, autodiscover_backends
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ from .registry import BACKEND_REGISTRY
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def get_registered_backends() -> list[str]:
|
||||||
|
"""Get list of registered backend names."""
|
||||||
|
return list(BACKEND_REGISTRY.keys())
|
||||||
|
|
||||||
|
|
||||||
def compute_embeddings(
|
def compute_embeddings(
|
||||||
chunks: list[str],
|
chunks: list[str],
|
||||||
model_name: str,
|
model_name: str,
|
||||||
|
|||||||
Reference in New Issue
Block a user