From 3bb289aeed915d3053dd15520d16f8d3ca5fa02e Mon Sep 17 00:00:00 2001 From: Sam Anklesaria Date: Tue, 2 Sep 2025 16:47:51 +0000 Subject: [PATCH 1/3] Revise example files --- examples/libtorchaudio/CMakeLists.txt | 3 --- examples/libtorchaudio/README.md | 1 - examples/libtorchaudio/speech_recognition/README.md | 6 +----- examples/self_supervised_learning/data_modules/__init__.py | 1 + 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/examples/libtorchaudio/CMakeLists.txt b/examples/libtorchaudio/CMakeLists.txt index b4cf58b375..3b6a0e2b08 100644 --- a/examples/libtorchaudio/CMakeLists.txt +++ b/examples/libtorchaudio/CMakeLists.txt @@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 3.5) project(libtorchaudio-cpp-example) -SET(BUILD_SOX ON CACHE BOOL "Build libsox into libtorchaudio") - -SET(BUILD_KALDI OFF CACHE BOOL "Build Kaldi into libtorchaudio") SET(BUILD_RNNT ON CACHE BOOL "Build RNN transducer into libtorchaudio") SET(BUILD_TORCHAUDIO_PYTHON_EXTENSION OFF CACHE BOOL "Build Python binding") diff --git a/examples/libtorchaudio/README.md b/examples/libtorchaudio/README.md index cfed769cd4..b7d58be7f3 100644 --- a/examples/libtorchaudio/README.md +++ b/examples/libtorchaudio/README.md @@ -1,6 +1,5 @@ # Libtorchaudio Examples -* [Augmentation](./augmentation) * [Speech Recognition with wav2vec2.0](./speech_recognition) ## Build diff --git a/examples/libtorchaudio/speech_recognition/README.md b/examples/libtorchaudio/speech_recognition/README.md index 124e754ef4..4a1afed8cd 100644 --- a/examples/libtorchaudio/speech_recognition/README.md +++ b/examples/libtorchaudio/speech_recognition/README.md @@ -1,10 +1,6 @@ # Speech Recognition with wav2vec2.0 -This example demonstarates how you can use torchaudio's I/O features and models to run speech recognition in C++ application. - -**NOTE** -This example uses `"sox_io"` backend for loading audio, which does not work on Windows. To make it work on -Windows, you need to replace the part of loading audio and converting it to Tensor object. +This example demonstarates how you can use torchaudio's models to run speech recognition in a C++ application. ## 1. Create a transcription pipeline TorchScript file diff --git a/examples/self_supervised_learning/data_modules/__init__.py b/examples/self_supervised_learning/data_modules/__init__.py index 3039832170..107a251da8 100644 --- a/examples/self_supervised_learning/data_modules/__init__.py +++ b/examples/self_supervised_learning/data_modules/__init__.py @@ -1,4 +1,5 @@ from ._hubert_datamodule import HuBERTDataModule +from ._wav2vec2_datamodule import Wav2Vec2DataModule __all__ = [ "HuBERTDataModule", From 53d7a0244f49ee1522af576fdebac71decf2bac1 Mon Sep 17 00:00:00 2001 From: Sam Anklesaria Date: Wed, 3 Sep 2025 14:56:15 +0000 Subject: [PATCH 2/3] Add example readme --- examples/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/README.md diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000000..ef7e68529f --- /dev/null +++ b/examples/README.md @@ -0,0 +1,12 @@ +The examples in this directory demonstrate applied use of the torchaudio library. They are included only for reference purposes. + +> [!NOTE] +> **We have transitioned TorchAudio into a +> maintenance phase. Our main goals were to reduce redundancies with the rest of the +> PyTorch ecosystem, make it easier to maintain, and create a version of +> TorchAudio that is more tightly scoped to its strengths: processing audio +> data for ML. Because of this transition, the examples included here will no longer be maintained +> going forward. The scripts may not work properly as is. For hands on examples of features in the +> library that *are* still supported, see the "tutorials" subdirectory. Please see +> [our community message](https://github.com/pytorch/audio/issues/3902) +> for more details.** From 33e00275f7dae1755bb78fb757cc47d3cd340e47 Mon Sep 17 00:00:00 2001 From: Sam Anklesaria Date: Wed, 3 Sep 2025 17:57:31 +0000 Subject: [PATCH 3/3] Remove BUILD_SOX and BUILD_KALI within examples --- examples/libtorchaudio/README.md | 2 -- examples/libtorchaudio/build.sh | 2 -- examples/libtorchaudio/speech_recognition/README.md | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/libtorchaudio/README.md b/examples/libtorchaudio/README.md index b7d58be7f3..b68fe509ea 100644 --- a/examples/libtorchaudio/README.md +++ b/examples/libtorchaudio/README.md @@ -19,8 +19,6 @@ mkdir build cd build cmake -GNinja \ -DCMAKE_PREFIX_PATH="$(python -c 'import torch;print(torch.utils.cmake_prefix_path)')" \ - -DBUILD_SOX=ON \ - -DBUILD_KALDI=OFF \ -DBUILD_RNNT=ON \ .. cmake --build . diff --git a/examples/libtorchaudio/build.sh b/examples/libtorchaudio/build.sh index ac51caf34c..cefd627bae 100755 --- a/examples/libtorchaudio/build.sh +++ b/examples/libtorchaudio/build.sh @@ -11,7 +11,5 @@ cd "${build_dir}" git submodule update cmake -GNinja \ -DCMAKE_PREFIX_PATH="$(python -c 'import torch;print(torch.utils.cmake_prefix_path)')" \ - -DBUILD_SOX=ON \ - -DBUILD_KALDI=OFF \ .. cmake --build . diff --git a/examples/libtorchaudio/speech_recognition/README.md b/examples/libtorchaudio/speech_recognition/README.md index 4a1afed8cd..74e0e5c7db 100644 --- a/examples/libtorchaudio/speech_recognition/README.md +++ b/examples/libtorchaudio/speech_recognition/README.md @@ -1,6 +1,6 @@ # Speech Recognition with wav2vec2.0 -This example demonstarates how you can use torchaudio's models to run speech recognition in a C++ application. +This example demonstrates how you can use torchaudio's models to run speech recognition in a C++ application. ## 1. Create a transcription pipeline TorchScript file