Fix docker GPU build for gptqmodel (#3018) #690
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: tests on transformers main | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - 'docs/**' | |
| permissions: {} | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Make space for cache + models | |
| # Ubuntu runner have less space free which is problematic since the model | |
| # cache + dependencies fill up the disk, leaving no space for execution. | |
| # So we remove some of the stuff we don't need (Java, .NET, etc.) | |
| # | |
| # Idea: https://dev.to/mathio/squeezing-disk-space-from-github-actions-runners-an-engineers-guide-3pjg | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| df -h | |
| # Remove Java (JDKs) | |
| sudo rm -rf /usr/lib/jvm | |
| # Remove .NET SDKs | |
| sudo rm -rf /usr/share/dotnet | |
| # Remove Swift toolchain | |
| sudo rm -rf /usr/share/swift | |
| # Remove Haskell (GHC) | |
| sudo rm -rf /usr/local/.ghcup | |
| # Remove Julia | |
| sudo rm -rf /usr/local/julia* | |
| # Remove Android SDKs | |
| sudo rm -rf /usr/local/lib/android | |
| # Remove Chromium (optional if not using for browser tests) | |
| sudo rm -rf /usr/local/share/chromium | |
| # Remove Microsoft/Edge and Google Chrome builds | |
| sudo rm -rf /opt/microsoft /opt/google | |
| # Remove Azure CLI | |
| sudo rm -rf /opt/az | |
| # Remove PowerShell | |
| sudo rm -rf /usr/local/share/powershell | |
| # Remove CodeQL and other toolcaches | |
| sudo rm -rf /opt/hostedtoolcache | |
| df -h | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: 3.11 | |
| cache: "pip" | |
| cache-dependency-path: "setup.py" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| # cpu version of pytorch | |
| pip install -U git+https://github.com/huggingface/transformers.git | |
| pip install -e .[test] | |
| - name: Test with pytest | |
| env: | |
| TRANSFORMERS_IS_CI: 1 | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| make test | |
| - name: Post to Slack | |
| if: always() | |
| uses: huggingface/hf-workflows/.github/actions/post-slack@3f88d63d3761558a32e8e46fc2a8536e04bb2aea # main from Feb 2025-02-24 | |
| with: | |
| slack_channel: ${{ secrets.SLACK_CHANNEL_ID }} | |
| title: 🤗 Results of transformers main tests | |
| status: ${{ job.status }} | |
| slack_token: ${{ secrets.SLACK_CIFEEDBACK_BOT_TOKEN }} |