diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 839d3b9b2..3e92ed9c0 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -904,14 +904,12 @@ jobs: echo "et-git-hash=$(cat ${TORCHCHAT_ROOT}/install/.pins/et-pin.txt)" >> "$GITHUB_ENV" - name: Load or install ET id: install-et - uses: actions/cache@v3 - env: - cache-key: et-build-${{runner.os}}-${{runner.arch}}-${{env.et-git-hash}} + uses: actions/cache@v4 with: - path: ./et-build - key: ${{env.cache-key}} - restore-keys: | - ${{env.cache-key}} + path: | + ./et-build + ./torchchat/utils/scripts + key: et-build-${{runner.os}}-${{runner.arch}}-${{env.et-git-hash}}-${{ hashFiles('**/install_et.sh') }} - if: ${{ steps.install-et.outputs.cache-hit != 'true' }} continue-on-error: true run: | diff --git a/install/install_requirements.sh b/install/install_requirements.sh index b483acae4..fa921cc69 100755 --- a/install/install_requirements.sh +++ b/install/install_requirements.sh @@ -103,5 +103,5 @@ fi ( set -x - $PIP_EXECUTABLE install lm-eval=="0.4.2" + $PIP_EXECUTABLE install evaluate=="0.4.3" lm-eval=="0.4.2" psutil=="6.0.0" ) diff --git a/torchchat/model.py b/torchchat/model.py index ab0bc7e21..0f60ea318 100644 --- a/torchchat/model.py +++ b/torchchat/model.py @@ -30,7 +30,9 @@ SequenceParallel, ) from torch.nn import functional as F - +# TODO: remove this after we figure out where in torchtune an `evaluate` module +# is being imported, which is being confused with huggingface's `evaluate``. +import lm_eval # noqa from torchtune.models.clip import clip_vision_encoder from torchtune.models.llama3_1._component_builders import llama3_1 as llama3_1_builder from torchtune.models.llama3_2_vision._component_builders import ( diff --git a/torchchat/utils/scripts/install_et.sh b/torchchat/utils/scripts/install_et.sh index 1d8c6e2b2..04db3b287 100755 --- a/torchchat/utils/scripts/install_et.sh +++ b/torchchat/utils/scripts/install_et.sh @@ -20,4 +20,9 @@ find_cmake_prefix_path clone_executorch install_executorch_libs $ENABLE_ET_PYBIND install_executorch_python_libs $ENABLE_ET_PYBIND +# TODO: figure out the root cause of 'AttributeError: module 'evaluate' +# has no attribute 'utils'' error from evaluate CI jobs and remove +# `import lm_eval` from torchchat.py since it requires a specific version +# of numpy. +pip install numpy=='1.26.4' popd