This library provides a PyTorch implementation of the Conformer model, an architecture that combines convolutional neural networks and transformers. It is designed to efficiently model both local and global dependencies in sequences, primarily for tasks like speech recognition. The library is currently at version 0.3.2.
pip install conformerVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to instantiate the `Conformer` model and perform a basic forward pass with dummy input data, illustrating its tensor input and output signatures.
Users are strongly advised to migrate to actively maintained Conformer implementations. Notable alternatives include `torchaudio.models.Conformer` for PyTorch users, or implementations found in libraries like Hugging Face Transformers.
Always verify the specific library and import path (e.g., `from conformer import Conformer` vs. `from torchaudio.models import Conformer`) to ensure you are using the intended Conformer implementation.
Install the library using pip: `pip install conformer`.
Import the `Conformer` class from its specific submodule, for example: `from conformer.model import Conformer`.
Ensure all input tensors are explicitly cast to the expected PyTorch data type, typically `torch.float32`: `input_tensor = input_tensor.to(torch.float32)`.
Reshape the input tensor to `(batch_size, sequence_length, feature_dimension)` and ensure any accompanying `lengths` tensor correctly reflects the batch size and valid sequence lengths for each element in the batch, adhering to the model's input expectations.