{"id":6334,"library":"conformer","title":"Conformer (lucidrains' PyTorch implementation)","description":"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.","status":"abandoned","version":"0.3.2","language":"en","source_language":"en","source_url":"https://github.com/lucidrains/conformer","tags":["deep-learning","neural-networks","speech-recognition","conformer","pytorch","audio","nlp","transformer"],"install":[{"cmd":"pip install conformer","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core deep learning framework for PyTorch models","package":"torch","optional":false}],"imports":[{"symbol":"Conformer","correct":"from conformer import Conformer"}],"quickstart":{"code":"import torch\nfrom conformer import Conformer\n\n# Define model parameters (example values)\nbatch_size, sequence_length, input_dim = 3, 12345, 80\nnum_classes = 10\nencoder_dim = 32\nnum_encoder_layers = 3\ndepthwise_conv_kernel_size = 31 # Common kernel size for Conformer\n\n# Instantiate the Conformer model\nmodel = Conformer(\n    num_classes=num_classes,\n    input_dim=input_dim,\n    encoder_dim=encoder_dim,\n    num_encoder_layers=num_encoder_layers,\n    depthwise_conv_kernel_size=depthwise_conv_kernel_size\n)\n\n# Create dummy input data (e.g., mel spectrograms and their lengths)\ninputs = torch.rand(batch_size, sequence_length, input_dim) # (batch, sequence_length, input_dim)\ninput_lengths = torch.LongTensor([12345, 12300, 12000]) # Actual lengths for each item in batch\n\n# Perform a forward pass\noutputs, output_lengths = model(inputs, input_lengths)\n\nprint(f\"Output features shape: {outputs.shape}\")\nprint(f\"Output lengths: {output_lengths}\")","lang":"python","description":"Demonstrates how to instantiate the `Conformer` model and perform a basic forward pass with dummy input data, illustrating its tensor input and output signatures."},"warnings":[{"fix":"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.","message":"The original GitHub repository for this library (https://github.com/lucidrains/conformer) has disappeared, and the author's account associated with it is no longer active. The library is effectively unmaintained, meaning no further updates, bug fixes, or official support are expected.","severity":"breaking","affected_versions":"0.1.0a - 0.3.2"},{"fix":"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.","message":"Due to the popularity of the Conformer architecture, there are multiple Python libraries and repositories that implement it. This specific PyPI package `conformer` corresponds to the implementation originally by 'lucidrains'. Be cautious to distinguish it from other implementations (e.g., `torchaudio.models.Conformer`, `conformer-tf`) when referencing documentation or examples to avoid compatibility issues.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}