patrickvonplaten commited on
Commit
c6c03f4
1 Parent(s): 14441d6

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -0
README.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Convert Fairseq Wav2Vec2 to HF
2
+
3
+ This repo has two scripts that can show how to convert a fairseq checkpoint to HF Transformers.
4
+
5
+ It's important to always check in a forward pass that the two checkpoints are the same. The procedure should be as follows:
6
+
7
+ 1. Download original model
8
+ 2. Create HF version of the model:
9
+ ```
10
+ huggingface-cli repo create <name_of_model> --organization <org_of_model>
11
+ git clone https://huggingface.co/<org_of_model>/<name_of_model>
12
+ ```
13
+ 3. Convert the model
14
+ ```
15
+ ./run_convert.sh <name_of_model> <path/to/orig/checkpoint/> 0
16
+ ```
17
+ The "0" means that checkpoint is **not** a fine-tuned one.
18
+ 4. Verify that models are equal:
19
+ ```
20
+ ./run_forward.py <name_of_model> <path/to/orig/checkpoint/> 0
21
+ ```
22
+
23
+ Check the scripts to better understand how they work or contact https://huggingface.co/patrickvonplaten