speechbrain icon indicating copy to clipboard operation
speechbrain copied to clipboard

couldn't find speechbrain.tokenizers.SentencePiece

Open geliAI opened this issue 2 years ago • 1 comments

speechbrain.tokenizers.SentencePiece Traceback (most recent call last): File "", line 1, in AttributeError: module 'speechbrain.tokenizers' has no attribute 'SentencePiece'

geliAI avatar Sep 08 '22 17:09 geliAI

Hello,

Could you please provide a minimal example that reproduces the error that you are facing? Thanks!

Adel-Moumen avatar Sep 08 '22 19:09 Adel-Moumen

Hello, any news please?

Adel-Moumen avatar Sep 23 '22 09:09 Adel-Moumen

Hello,

Could you please provide a minimal example that reproduces the error that you are facing? Thanks!

conda create --name sb_test python=3.9 conda activate sb_test python

import speechbrain speechbrain.tokenizers.SentencePiece.SentencePiece Traceback (most recent call last): File "", line 1, in AttributeError: module 'speechbrain.tokenizers' has no attribute 'SentencePiece'

I was trying to reproduce this line: https://github.com/speechbrain/speechbrain/blob/develop/templates/speech_recognition/Tokenizer/tokenizer.yaml#L25

geliAI avatar Sep 23 '22 13:09 geliAI

Hello @gelimcgill,

Please use from instead of import when fetching a specific class:

from speechbrain.tokenizers.SentencePiece import SentencePiece

if __name__ == "__main__":
  print(SentencePiece)

Best.

Adel-Moumen avatar Sep 28 '22 19:09 Adel-Moumen