Skip to content

Commit

Permalink
Move tests which support model training into a separate train_tests
Browse files Browse the repository at this point in the history
… directory.

PiperOrigin-RevId: 632606966
  • Loading branch information
sdenton4 authored and copybara-github committed May 10, 2024
1 parent 07b56b9 commit 11b849c
Show file tree
Hide file tree
Showing 24 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ jobs:
poetry install --with jaxtrain
- name: Test with unittest
run: poetry run python -m unittest discover -s chirp/tests -p "*test.py"
- name: Test training with unittest
run: poetry run python -m unittest discover -s chirp/train_tests -p "*test.py"
- name: Test inference with unittest
run: poetry run python -m unittest discover -s chirp/inference/tests -p "*test.py"
3 changes: 2 additions & 1 deletion .github/workflows/ci_no_jaxtrain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ jobs:
sudo apt-get install libsndfile1 ffmpeg
poetry install --without jaxtrain
- name: Test with unittest
# TODO: Group together jaxtrain tests so they can be easily excluded.
run: poetry run python -m unittest discover -s chirp/tests -p "*test.py"
- name: Test inference with unittest
run: poetry run python -m unittest discover -s chirp/inference/tests -p "*test.py"
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from chirp.eval import callbacks
from chirp.eval import eval_lib
from chirp.taxonomy import namespace_db
from chirp.tests import fake_dataset
from chirp.train_tests import fake_dataset
from chirp.train import classifier
import ml_collections
import numpy as np
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import tempfile

from chirp.data import filter_scrub_utils as fsu
from chirp.tests import fake_dataset
from chirp.train_tests import fake_dataset
import pandas as pd
import tensorflow_datasets as tfds

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
from chirp.configs import hubert_base_pq
from chirp.data import utils as data_utils
from chirp.preprocessing import pipeline
from chirp.tests import fake_dataset
from chirp.train import hubert as hubert_train
from chirp.train_tests import fake_dataset
from clu import checkpoint
from flax import linen as nn
import jax
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from chirp.preprocessing import pipeline
from chirp.taxonomy import namespace
from chirp.taxonomy import namespace_db
from chirp.tests import fake_dataset
from chirp.train_tests import fake_dataset
from jax import numpy as jnp
import numpy as np
import tensorflow as tf
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from chirp.configs import separator as separator_config
from chirp.data import utils as data_utils
from chirp.data.bird_taxonomy import bird_taxonomy
from chirp.tests import fake_dataset
from chirp.train_tests import fake_dataset
from chirp.train import separator
from clu import checkpoint
import jax
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

def _manual_data_dir() -> str:
return os.path.join(
os.path.normpath(os.path.dirname(__file__)),
os.path.normpath(os.path.dirname(os.path.dirname(__file__))),
'tests',
'testdata',
'tfds_builder_wav_directory_test',
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from chirp.models import frontend
from chirp.preprocessing import pipeline
from chirp.taxonomy import namespace
from chirp.tests import fake_dataset
from chirp.train_tests import fake_dataset
from chirp.train import classifier
from clu import checkpoint
from flax import linen as nn
Expand Down

0 comments on commit 11b849c

Please sign in to comment.