Check text embedding output shape before applying pooling #952
This file contains 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: Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
main: | |
name: "main (${{ matrix.pair.elixir }}, ${{ matrix.pair.otp }})" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: | |
elixir: "1.15.4" | |
otp: "26.0.2" | |
lint: true | |
slow: true | |
- pair: | |
elixir: "1.14.5" | |
otp: "25.3.2.2" | |
env: | |
MIX_ENV: test | |
XLA_CACHE_DIR: ${{ github.workspace }}/cache/xla | |
LIBTORCH_DIR: ${{ github.workspace }}/cache/torch | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{ matrix.pair.otp }} | |
elixir-version: ${{ matrix.pair.elixir }} | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
deps | |
_build | |
cache | |
key: ${{ runner.os }}-mix-${{ matrix.pair.elixir }}-${{ matrix.pair.otp }}-${{ hashFiles('**/mix.lock') }} | |
- run: mix deps.get | |
- run: mix format --check-formatted | |
if: ${{ matrix.lint }} | |
- run: mix deps.unlock --check-unused | |
if: ${{ matrix.lint }} | |
- run: mix deps.compile | |
- run: mix compile --warnings-as-errors | |
if: ${{ matrix.lint }} | |
- name: Restore bumblebee cache | |
id: cache-bumblebee-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: bumblebee_cache | |
key: ${{ runner.os }}-bumblebee-cache-${{ matrix.pair.elixir }}-${{ matrix.pair.otp }} | |
- run: mix test | |
env: | |
BUMBLEBEE_CACHE_DIR: ${{ github.workspace }}/bumblebee_cache | |
- name: Save bumblebee cache | |
id: cache-bumblebee-save | |
uses: actions/cache/save@v3 | |
with: | |
path: bumblebee_cache | |
key: ${{ steps.cache-bumblebee-restore.outputs.cache-primary-key }} | |
- uses: technote-space/get-diff-action@v6 | |
with: | |
PATTERNS: test/**/*_test.exs | |
- name: Changed slow tests | |
# mix test exits with a non-zero code if there are no matching tests, | |
# so we make sure we fail only when the test suite fails | |
run: mix test test/bumblebee_test.exs --only slow --exit-status 100 ${{ env.GIT_DIFF_FILTERED }} || [ $? -ne 100 ] | |
if: ${{ matrix.slow && env.GIT_DIFF_FILTERED != '' }} |