rust-bert icon indicating copy to clipboard operation
rust-bert copied to clipboard

Wav2Vec2

Open ChrisBeeson opened this issue 1 year ago • 3 comments

How tricky would it be to implement Wav2Vec2?

ChrisBeeson avatar Aug 27 '22 06:08 ChrisBeeson

Hello @ChrisBeeson ,

The transformer model itself is probably rather straightforward to implement as it seems to use standard Torch operations throughout that are supported in tch-rs.

The tricky part is the pre-processing and tokenization process for the model that would differ significantly from the existing tokenizer, since the input would be an audio file. One would need to identify an alternative in Rust to load audio files, build a sampling, tensor conversion and padding module and the associated tokenizer, which would represent a significant amount of work.

I would welcome a pull request for this feature, but this would probably meaning getting started with a pre-processing/tokenization implementation, either directly in https://github.com/guillaume-be/rust-tokenizers or as in a separate crate/dependency.

guillaume-be avatar Sep 03 '22 17:09 guillaume-be

Hi @guillaume-be,

Thanks for your thoughts on this.

Would porting the hugging face tokenizer and the feature extractor be a good starting point?

ChrisBeeson avatar Sep 12 '22 23:09 ChrisBeeson