File size: 821 Bytes
c6c03f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Convert Fairseq Wav2Vec2 to HF

This repo has two scripts that can show how to convert a fairseq checkpoint to HF Transformers.

It's important to always check in a forward pass that the two checkpoints are the same. The procedure should be as follows:

1. Download original model
2. Create HF version of the model:
```
huggingface-cli repo create <name_of_model> --organization <org_of_model>
git clone https://huggingface.co/<org_of_model>/<name_of_model>
```
3. Convert the model
```
./run_convert.sh <name_of_model> <path/to/orig/checkpoint/> 0
```
The "0" means that checkpoint is **not** a fine-tuned one.
4. Verify that models are equal:
```
./run_forward.py <name_of_model> <path/to/orig/checkpoint/> 0
```

Check the scripts to better understand how they work or contact https://huggingface.co/patrickvonplaten