@@ -46,24 +46,27 @@ jobs:
4646 repository : ggml-org/llama.cpp
4747 path : llama.cpp
4848
49- - name : Install llama.cpp conversion requirements
50- run : pip install -r llama.cpp/requirements/requirements-convert_hf_to_gguf.txt
51-
52- # The conversion requirements pin a specific torch version (e.g.
53- # torch==2.11.0), which downgrades the torch installed above. Any
54- # torchaudio/torchvision left over from a previous torch build is then
55- # compiled against the wrong torch and raises at import time. transformers
56- # imports torchaudio lazily, so the mismatch surfaces as
57- # "ModuleNotFoundError: Could not import module 'LlamaForCausalLM'".
58- # Removing them avoids the mismatch (this test only needs torch).
59- - name : Uninstall torchaudio and torchvision to avoid torch mismatch
60- run : pip uninstall -y torchaudio torchvision 2>/dev/null || true
49+ # The conversion requirements pin specific torch/transformers/numpy
50+ # versions (e.g. torch==2.11.0, transformers==4.57.6, numpy~=1.26.4) that
51+ # conflict with the versions modelbuilder and onnxruntime-genai rely on.
52+ # Installing them into the main environment downgrades that stack and
53+ # breaks AutoModelForCausalLM resolution (the test then fails with
54+ # "Could not find LlamaForCausalLM neither in ... nor in ..."). To keep
55+ # the two stacks fully decoupled we install the conversion requirements
56+ # in a dedicated virtual environment and point the test at it through
57+ # LLAMA_CPP_CONVERT_PYTHON.
58+ - name : Create isolated environment for the GGUF conversion
59+ run : |
60+ python -m venv "${{ github.workspace }}/.gguf-venv"
61+ "${{ github.workspace }}/.gguf-venv/bin/python" -m pip install --upgrade pip
62+ "${{ github.workspace }}/.gguf-venv/bin/python" -m pip install -r llama.cpp/requirements/requirements-convert_hf_to_gguf.txt
6163
6264 - name : Run llama.cpp vs onnxruntime-genai tests
6365 env :
6466 HF_TOKEN : ${{ secrets.HF_TOKEN || secrets.HUGGING_FACE_HUB_TOKEN }}
6567 HUGGING_FACE_HUB_TOKEN : ${{ secrets.HUGGING_FACE_HUB_TOKEN || secrets.HF_TOKEN }}
6668 LLAMA_CPP_DIR : ${{ github.workspace }}/llama.cpp
69+ LLAMA_CPP_CONVERT_PYTHON : ${{ github.workspace }}/.gguf-venv/bin/python
6770 run : LONGTEST=1 pytest tests/fast_llama_cpp -v --cov=modelbuilder --cov-report=xml --cov-report=term-missing
6871
6972 - name : Upload coverage to Codecov
0 commit comments