Skip to content

Commit

Permalink
Add an import test for non-jaxtrain CI.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 614705474
  • Loading branch information
sdenton4 authored and copybara-github committed Mar 11, 2024
1 parent df60818 commit 735f17d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions chirp/tests/inference_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,20 @@

import apache_beam as beam
from apache_beam.testing import test_pipeline
from chirp import audio_utils
from chirp import config_utils
from chirp import path_utils
from chirp.inference import colab_utils
from chirp.inference import embed_lib
from chirp.inference import interface
from chirp.inference import models
from chirp.inference import tf_examples
from chirp.models import metrics
from chirp.projects.bootstrap import bootstrap
from chirp.projects.bootstrap import display
from chirp.projects.bootstrap import search
from chirp.projects.multicluster import classify
from chirp.projects.multicluster import data_lib
from chirp.taxonomy import namespace
from etils import epath
from ml_collections import config_dict
Expand All @@ -49,6 +58,20 @@ def _make_output_head_model(model_path: str, embedding_dim: int = 1280):

class InferenceTest(parameterized.TestCase):

def test_imports(self):
# Test that imports work in external github environment.
# This explicitly tests that libraries commonly used in Colab workflows
# can be imported when Perch is installed without Jax training dependencies.
self.assertIsNotNone(audio_utils)
self.assertIsNotNone(bootstrap)
self.assertIsNotNone(classify)
self.assertIsNotNone(colab_utils)
self.assertIsNotNone(config_utils)
self.assertIsNotNone(data_lib)
self.assertIsNotNone(display)
self.assertIsNotNone(metrics)
self.assertIsNotNone(search)

@parameterized.parameters(
# Test each output type individually.
{'make_embeddings': True},
Expand Down

0 comments on commit 735f17d

Please sign in to comment.