'S2STransformerBeamSearcher' object has no attribute 'ctc_forward_step'
Mickaelh51 opened this issue · 2 comments
Mickaelh51 commented
Describe the bug
Hi all,
I want to test alignment with this code:
from speechbrain.inference.ASR import EncoderDecoderASR
from speechbrain.alignment.ctc_segmentation import CTCSegmentation
# load an ASR model
pre_trained = "speechbrain/asr-transformer-transformerlm-librispeech"
asr_model = EncoderDecoderASR.from_hparams(source=pre_trained)
aligner = CTCSegmentation(asr_model, kaldi_style_text=False)
# load data
audio_path = "/content/speechbrain/tests/samples/single-mic/example1.wav"
text = ["THE BIRCH CANOE", "SLID ON THE", "SMOOTH PLANKS"]
segments = aligner(audio_path, text, name="example1")
Script can download model
but I have this error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
[<ipython-input-4-cb3639878d03>](https://localhost:8080/#) in <cell line: 6>()
4 pre_trained = "speechbrain/asr-transformer-transformerlm-librispeech"
5 asr_model = EncoderDecoderASR.from_hparams(source=pre_trained)
----> 6 aligner = CTCSegmentation(asr_model, kaldi_style_text=False)
7 # load data
8 audio_path = "/content/speechbrain/tests/samples/single-mic/example1.wav"
1 frames
[/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py](https://localhost:8080/#) in __getattr__(self, name)
1693 if name in modules:
1694 return modules[name]
-> 1695 raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
1696
1697 def __setattr__(self, name: str, value: Union[Tensor, 'Module']) -> None:
AttributeError: 'S2STransformerBeamSearcher' object has no attribute 'ctc_forward_step'
Thanks in advance for your help !
Expected behaviour
No error, just use it ;)
To Reproduce
Steps to reproduce : https://colab.research.google.com/drive/1KmSi3gMppj-664mpzu16qUfdV-h9jG-5?usp=sharing
Environment Details
speechbrain 1.0.0 /content/speechbrain
ctc_segmentation 1.7.4
Relevant Log Output
No response
Additional Context
No response
TParcollet commented
@Adel-Moumen I guess that CTCSegmentation was not adapted to 1.0?
Adel-Moumen commented
it seems indeed. I will take a look asap.