Joblib
Safetensors
hubert
mxmpl commited on
Commit
205215f
·
unverified ·
1 Parent(s): 3e89de8

update README

Browse files
Files changed (1) hide show
  1. README.md +23 -3
README.md CHANGED
@@ -39,12 +39,13 @@ model = HubertModel.from_pretrained("coml/hubert-base-vp20")
39
 
40
  Or with `minimal_hubert`:
41
  ```python
 
42
  from minimal_hubert import HuBERT, HuBERTPretrain
43
 
44
  # Standard model
45
  model = HuBERT.from_pretrained("coml/hubert-base-vp20")
46
  # With pretraining head for classification
47
- model_for_pretraining = HuBERTPretrain.from_pretrained("https://huggingface.co/coml/hubert-base-vp20/resolve/main/it2.pt")
48
  ```
49
 
50
  Check out [`minimal_hubert`](https://github.com/mxmpl/minimal_hubert) if you are interested in pretraining or want
@@ -53,12 +54,31 @@ to load HuBERT checkpoints from different libraries.
53
  ## Files:
54
 
55
  - `model.safetensors` and `config.json`: HuggingFace Transformers checkpoint and config.
56
- - `it1.pt`: 1st iteration checkpoint.
57
- - `it2.pt`: 2nd iteration checkpoint. Converted to HuggingFace state_dict to get `model.safetensors`.
58
  - `km100-mfcc.joblib`: K-means trained on MFCCs of VoxPopuli-20. Used to train the 1st iteration.
59
  - `km500-it1-l10.joblib`: K-means trained on features from the 10th layer of the 1st iteration model. Used to train the 2nd iteration.
60
  - `km256-it2-l11.joblib`: K-means trained on features from the 11th layer of the 2nd iteration model. Used for DiscoPhon finetuning.
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  ## Citing
63
 
64
  ```bibtex
 
39
 
40
  Or with `minimal_hubert`:
41
  ```python
42
+ from huggingface_hub import hf_hub_download
43
  from minimal_hubert import HuBERT, HuBERTPretrain
44
 
45
  # Standard model
46
  model = HuBERT.from_pretrained("coml/hubert-base-vp20")
47
  # With pretraining head for classification
48
+ model_for_pretraining = HuBERTPretrain.from_pretrained(hf_hub_download("coml/hubert-base-vp20", "it2.pt"))
49
  ```
50
 
51
  Check out [`minimal_hubert`](https://github.com/mxmpl/minimal_hubert) if you are interested in pretraining or want
 
54
  ## Files:
55
 
56
  - `model.safetensors` and `config.json`: HuggingFace Transformers checkpoint and config.
57
+ - `it1.pt`: 1st iteration checkpoint (model weights with pretraining head, epoch and step).
58
+ - `it2.pt`: 2nd iteration checkpoint (model weights with pretraining head, epoch and step). Converted to HuggingFace state_dict to get `model.safetensors`.
59
  - `km100-mfcc.joblib`: K-means trained on MFCCs of VoxPopuli-20. Used to train the 1st iteration.
60
  - `km500-it1-l10.joblib`: K-means trained on features from the 10th layer of the 1st iteration model. Used to train the 2nd iteration.
61
  - `km256-it2-l11.joblib`: K-means trained on features from the 11th layer of the 2nd iteration model. Used for DiscoPhon finetuning.
62
 
63
+ ## Intermediate checkpoints
64
+
65
+ The [`checkpoints`](https://huggingface.co/coml/hubert-base-vp20/tree/checkpoints) branch contains the intermediate
66
+ checkpoints of both iterations, as saved by `minimal_hubert`: `it1/step_*.pt` and `it1/final.pt` for the 1st iteration,
67
+ `it2/step_*.pt` and `it2/final.pt` for the 2nd one.
68
+ The `step_*.pt` files contain the model weights (with pretraining head), epoch and step.
69
+ The `final.pt` files also contain the optimizer, scheduler and gradient scaler states, to resume training.
70
+
71
+ List them with `hf models ls coml/hubert-base-vp20 -R --revision checkpoints`, and load one with:
72
+
73
+ ```python
74
+ from huggingface_hub import hf_hub_download
75
+ from minimal_hubert import HuBERT, HuBERTPretrain
76
+
77
+ path = hf_hub_download("coml/hubert-base-vp20", "it1/step_50000.pt", revision="checkpoints")
78
+ model = HuBERT.from_pretrained(path)
79
+ model_for_pretraining = HuBERTPretrain.from_pretrained(path)
80
+ ```
81
+
82
  ## Citing
83
 
84
  ```bibtex