diff --git a/chirp/inference/embed_lib.py b/chirp/inference/embed_lib.py index 146d6933..b46e8253 100644 --- a/chirp/inference/embed_lib.py +++ b/chirp/inference/embed_lib.py @@ -84,7 +84,13 @@ def create_source_infos( """ source_files = [] for pattern in source_file_patterns: - for source_file in epath.Path('').glob(pattern): + if '://' in pattern: + root, pattern = pattern.split('://') + root = root + '://' + else: + root = '' + + for source_file in epath.Path(root).glob(pattern): source_files.append(source_file) source_file_splits = [] diff --git a/chirp/inference/tests/embed_test.py b/chirp/inference/tests/embed_test.py index fac351cb..7bccaeb2 100644 --- a/chirp/inference/tests/embed_test.py +++ b/chirp/inference/tests/embed_test.py @@ -435,7 +435,11 @@ def test_frame_audio(self): def test_create_source_infos(self): # Just one file, but it's all good. - globs = [path_utils.get_absolute_path('inference/tests/testdata/clap.wav')] + globs = [ + path_utils.get_absolute_path( + 'inference/tests/testdata/clap.wav' + ).as_posix() + ] # Disable sharding by setting shard_len_s <= 0. got_infos = embed_lib.create_source_infos( globs, shard_len_s=-1, num_shards_per_file=100