diff --git a/.github/workflows/build-wheels-cuda-win.yml b/.github/workflows/build-wheels-cuda-win.yml index 156c99fd9..3c8a6db21 100644 --- a/.github/workflows/build-wheels-cuda-win.yml +++ b/.github/workflows/build-wheels-cuda-win.yml @@ -73,6 +73,10 @@ jobs: with: python-version: ${{ matrix.pyver }} + - name: Setup uv venv + run: | + uv venv + - name: Install Dependencies run: | git config --system core.longpaths true diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 95f6e5a27..3ce77fe78 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -50,16 +50,30 @@ jobs: with: path: ~/.cache/huggingface/hub key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }} + + - name: Install curl dependencies + run: | + sudo apt update && + sudo apt upgrade -y && + sudo apt install -y curl libcurl4-openssl-dev + shell: bash # explicitly specifying bash shell' + + - name: Find CURL paths (Linux) + run: | + echo "CURL_INCLUDE_DIR=/usr/include/curl" >> $GITHUB_ENV + echo "CURL_LIBRARY=/usr/lib/x86_64-linux-gnu/libcurl.so" >> $GITHUB_ENV + shell: bash + - name: Install dependencies (Linux/MacOS) run: | python -m pip install --upgrade pip python -m pip install uv - python -m uv pip install -e .[all] --verbose + python -m uv pip install -e .[all] --verbose --config-settings="cmake.define.CURL_INCLUDE_DIR=$CURL_INCLUDE_DIR" --config-settings="cmake.define.CURL_LIBRARY=$CURL_LIBRARY" shell: bash + - name: Test with pytest run: | python -m pytest - build-windows: needs: download-model runs-on: windows-latest @@ -70,7 +84,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: "recursive" - + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -87,9 +101,9 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install uv - python -m uv pip install -e .[all] --verbose + python -m uv pip install -e .[all] --verbose --config-settings="cmake.define.LLAMA_CURL=OFF" shell: cmd - + - name: Test with pytest run: | python -m pytest diff --git a/llama_cpp/_internals.py b/llama_cpp/_internals.py index a00c8925a..e163b23ca 100644 --- a/llama_cpp/_internals.py +++ b/llama_cpp/_internals.py @@ -756,7 +756,7 @@ def free_wrapper(sampler: llama_cpp.llama_sampler_p): self.sampler = llama_cpp.llama_sampler_init(ctypes.pointer(sampler_i), None) def get_sampler(self) -> llama_cpp.llama_sampler_p: - return ctypes.pointer(self.sampler) + return self.sampler class LlamaSampler: