# How do I instantiate a Wav2Vec2Processor with a phoneme tokenizer?

**URL:** <https://discuss.huggingface.co/t/how-do-i-instantiate-a-wav2vec2processor-with-a-phoneme-tokenizer/143122>\
**Category:** 🤗Datasets\
**Created:** [February 26, 2025, 9:57pm UTC](https://discuss.huggingface.co/t/how-do-i-instantiate-a-wav2vec2processor-with-a-phoneme-tokenizer/143122 "2025-02-26T21:57:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacobs3330](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@jacobs3330](https://discuss.huggingface.co/u/jacobs3330)\
**Post date:** [February 26, 2025, 9:57pm UTC](https://discuss.huggingface.co/t/how-do-i-instantiate-a-wav2vec2processor-with-a-phoneme-tokenizer/143122/1 "2025-02-26T21:57:53Z")

</div>

Wav2Vec2Phoneme documentation is at [Wav2Vec2Phoneme](https://huggingface.co/docs/transformers/en/model_doc/wav2vec2_phoneme).  
It says that output has to be decoded using Wav2Vec2PhonemeCTCTokenizer.

The documentation for huggingface models other=phoneme-recognition  
includes a reference to [facebook/wav2vec2-xlsr-53-espeak-cv-ft · Hugging Face](https://huggingface.co/facebook/wav2vec2-xlsr-53-espeak-cv-ft)

The source code there includes the line

processor = Wav2Vec2Processor.from\_pretrained(checkpoint)

Execution explodes, complaining about a missing tokenizer. It is likely that the documentation  
is incorrect.

I tried instantiating a Wav2Vec2PhonemeCTCTokenizer (using a vocab file in the huggingface cache).  
If I’m right, the documentation will need to changed. The download will need to be changed  
to provide the vocab\_file, too (I fished the json out of the huggingface cache).

tokenizer = Wav2Vec2PhonemeCTCTokenizer(vocab\_file=‘wav2vec2-lv-60-espeak-cv-ft-vocab.json’)  
processor = Wav2Vec2Processor.from\_pretrained(checkpoint, tokenizer)

There is a legal problem with my using this (a requirement for espeak which has a GPL license),  
so I want to make sure that the above two lines are correct. Are they?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [February 27, 2025, 11:14am UTC](https://discuss.huggingface.co/t/how-do-i-instantiate-a-wav2vec2processor-with-a-phoneme-tokenizer/143122/2 "2025-02-27T11:14:33Z")

</div>

It’s probably been like that for a few years…😅

> **[facebook/wav2vec2-xlsr-53-espeak-cv-ft · Demo does not work](https://huggingface.co/facebook/wav2vec2-xlsr-53-espeak-cv-ft/discussions/1)**
>
> When running the demo, I get the following "Can't load tokenizer using from\_pretrained, please update its configuration: Wav2Vec2PhonemeCTCTokenizer requires the phonemizer library but it was not f...
