Skip to content
Open
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
39 changes: 33 additions & 6 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,21 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-13", "windows-latest" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
os: [ "ubuntu-latest", "macos-13", "windows-latest", "macos-14" ]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
module: [ "xinference" ]
exclude:
- { os: macos-13, python-version: 3.10 }
- { os: macos-13, python-version: 3.11 }
- { os: macos-13, python-version: 3.12 }
- { os: macos-13, python-version: 3.13 }
- { os: macos-14, python-version: 3.9 }
- { os: macos-14, python-version: 3.10 }
- { os: macos-14, python-version: 3.11 }
- { os: macos-14, python-version: 3.12 }
- { os: windows-latest, python-version: 3.10 }
- { os: windows-latest, python-version: 3.11 }
- { os: windows-latest, python-version: 3.12 }
include:
- { os: self-hosted, module: gpu, python-version: 3.9}
- { os: macos-latest, module: metal, python-version: "3.10" }
Expand All @@ -99,15 +106,21 @@ jobs:
python-version: ${{ matrix.python-version }}
activate-environment: ${{ env.CONDA_ENV }}

# Important for python == 3.12
# Important for python == 3.12 and 3.13
- name: Update pip and setuptools
if: ${{ matrix.python-version == '3.12' }}
if: ${{ matrix.python-version == '3.12' || matrix.python-version == '3.13' }}
run: |
python -m pip install -U pip setuptools

# Install torch for Python 3.13 using nightly builds
- name: Install torch for Python 3.13
if: ${{ matrix.python-version == '3.13'}}
run: |
python -m pip install torch torchvision torchaudio

- name: Install numpy
if: |
(startsWith(matrix.os, 'macos') && (matrix.python-version == '3.12' || matrix.python-version == '3.9')) ||
(startsWith(matrix.os, 'macos') && (matrix.python-version == '3.13' || matrix.python-version == '3.9')) ||
(startsWith(matrix.os, 'windows') && matrix.python-version == '3.9')
run: |
python -m pip install "numpy<2"
Expand Down Expand Up @@ -139,7 +152,9 @@ jobs:
pip install "transformers<4.49"
pip install attrdict
pip install "timm>=0.9.16"
pip install torch torchvision
if [ "${{ matrix.python-version }}" != "3.13" ]; then
pip install torch torchvision
fi
pip install accelerate
pip install sentencepiece
pip install transformers_stream_generator
Expand All @@ -158,9 +173,21 @@ jobs:
fi
working-directory: .

- name: Clean up disk
if: |
(startsWith(matrix.os, 'ubuntu'))
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
df -h

- name: Test with pytest
env:
MODULE: ${{ matrix.module }}
PYTORCH_MPS_HIGH_WATERMARK_RATIO: 1.0
run: |
if [ "$MODULE" == "gpu" ]; then
${{ env.SELF_HOST_PYTHON }} -m pip install -U -e ".[audio]"
Expand Down
1 change: 1 addition & 0 deletions xinference/core/tests/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ async def test_disable_metrics_exporter_server(disable_metrics, setup_cluster):
requests.get(metrics_exporter_address)


@pytest.mark.timeout(300) # 5 minutes timeout to prevent hanging in Python 3.13
async def test_metrics_exporter_data(setup_cluster):
endpoint, metrics_exporter_address, supervisor_address = setup_cluster

Expand Down
24 changes: 21 additions & 3 deletions xinference/model/embedding/tests/test_embedding_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,27 @@ def test_register_fault_embedding():

with pytest.warns(UserWarning) as record:
_install()
assert any(
"Invalid model URI /new_data/cache/gte-Qwen2" in str(r.message) for r in record
)

# Check for warning message containing the invalid model URI error
# The warning format is: "{user_defined_embedding_dir}/{f} has error, {e}"
# where e contains the ValueError message
found_warning = False
for warning in record:
message = str(warning.message)
if (
"has error" in message
and (
"Invalid model URI" in message
or "Model URI cannot be a relative path" in message
)
and "/new_data/cache/gte-Qwen2" in message
):
found_warning = True
break

assert (
found_warning
), f"Expected warning about invalid model URI not found. Warnings: {[str(w.message) for w in record]}"


def test_convert_ids_to_tokens():
Expand Down
Loading