PINT Stage A: weights, k-means codebooks and model card
Browse files- NOTICE +6 -0
- README.md +58 -0
- config.json +76 -0
- kmeans_100.safetensors +3 -0
- kmeans_1000.safetensors +3 -0
- kmeans_200.safetensors +3 -0
- kmeans_250.safetensors +3 -0
- kmeans_50.safetensors +3 -0
- kmeans_500.safetensors +3 -0
- model.safetensors +3 -0
- pint_config.json +15 -0
- preprocessor_config.json +9 -0
NOTICE
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This model is derived from facebook/hubert-base-ls960
|
| 2 |
+
(https://huggingface.co/facebook/hubert-base-ls960), Copyright (c) Meta Platforms, Inc.,
|
| 3 |
+
licensed under the Apache License, Version 2.0
|
| 4 |
+
(https://www.apache.org/licenses/LICENSE-2.0). The encoder weights were modified by
|
| 5 |
+
fine-tuning. The fine-tuned weights and every other file in this repository are released
|
| 6 |
+
under CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/).
|
README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
library_name: pint-infer
|
| 4 |
+
pipeline_tag: feature-extraction
|
| 5 |
+
base_model: facebook/hubert-base-ls960
|
| 6 |
+
tags:
|
| 7 |
+
- speech
|
| 8 |
+
- audio
|
| 9 |
+
- tokenizer
|
| 10 |
+
- hubert
|
| 11 |
+
- speech-tokens
|
| 12 |
+
language:
|
| 13 |
+
- en
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# PINT Stage A
|
| 17 |
+
|
| 18 |
+
A HuBERT-base encoder fine-tuned on parallel utterances (the same words from different speakers and recording conditions) so that they map to the same frame-level representation. 16 kHz audio in, one 768-d vector per 20 ms frame out; token ids come from k-means codebooks.
|
| 19 |
+
|
| 20 |
+
## Usage
|
| 21 |
+
|
| 22 |
+
```bash
|
| 23 |
+
pip install git+https://github.com/nyralabs/pint-infer
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
```python
|
| 27 |
+
from pint_infer import PINTTokenizer
|
| 28 |
+
|
| 29 |
+
tok = PINTTokenizer.from_pretrained("nyralabs/pint-stage-a")
|
| 30 |
+
ids = tok.encode("speech.wav", method="kmeans_200") # one token id per 20 ms
|
| 31 |
+
frames = tok.embed("speech.wav") # (T, 768) float32
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
Methods: `kmeans_50`, `kmeans_100`, `kmeans_200`, `kmeans_250`, `kmeans_500`, `kmeans_1000`.
|
| 35 |
+
|
| 36 |
+
## Files
|
| 37 |
+
|
| 38 |
+
| File | Content |
|
| 39 |
+
|---|---|
|
| 40 |
+
| `model.safetensors`, `config.json`, `preprocessor_config.json` | HuBERT-base encoder and feature extractor |
|
| 41 |
+
| `kmeans_<k>.safetensors` | `(k, 768)` k-means cluster centers; assignment is nearest centroid |
|
| 42 |
+
| `pint_config.json` | frame rate, codebook list |
|
| 43 |
+
|
| 44 |
+
k=200 matches the vocabulary of the Stage B token head; the other codebook sizes are provided for convenience.
|
| 45 |
+
|
| 46 |
+
## Intended use and limitations
|
| 47 |
+
|
| 48 |
+
English speech. Input is converted to 16 kHz mono. Research and non-commercial use.
|
| 49 |
+
|
| 50 |
+
## Citation
|
| 51 |
+
|
| 52 |
+
A citation will be added on publication.
|
| 53 |
+
|
| 54 |
+
## License
|
| 55 |
+
|
| 56 |
+
The weights are released under CC BY-NC 4.0. They are derived from
|
| 57 |
+
[facebook/hubert-base-ls960](https://huggingface.co/facebook/hubert-base-ls960), licensed under
|
| 58 |
+
the Apache License 2.0; see `NOTICE`.
|
config.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_dropout": 0.1,
|
| 3 |
+
"apply_spec_augment": true,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"HubertModel"
|
| 6 |
+
],
|
| 7 |
+
"attention_dropout": 0.1,
|
| 8 |
+
"bos_token_id": 1,
|
| 9 |
+
"classifier_proj_size": 256,
|
| 10 |
+
"conv_bias": false,
|
| 11 |
+
"conv_dim": [
|
| 12 |
+
512,
|
| 13 |
+
512,
|
| 14 |
+
512,
|
| 15 |
+
512,
|
| 16 |
+
512,
|
| 17 |
+
512,
|
| 18 |
+
512
|
| 19 |
+
],
|
| 20 |
+
"conv_kernel": [
|
| 21 |
+
10,
|
| 22 |
+
3,
|
| 23 |
+
3,
|
| 24 |
+
3,
|
| 25 |
+
3,
|
| 26 |
+
2,
|
| 27 |
+
2
|
| 28 |
+
],
|
| 29 |
+
"conv_pos_batch_norm": false,
|
| 30 |
+
"conv_stride": [
|
| 31 |
+
5,
|
| 32 |
+
2,
|
| 33 |
+
2,
|
| 34 |
+
2,
|
| 35 |
+
2,
|
| 36 |
+
2,
|
| 37 |
+
2
|
| 38 |
+
],
|
| 39 |
+
"ctc_loss_reduction": "sum",
|
| 40 |
+
"ctc_zero_infinity": false,
|
| 41 |
+
"do_stable_layer_norm": false,
|
| 42 |
+
"dtype": "float32",
|
| 43 |
+
"eos_token_id": 2,
|
| 44 |
+
"feat_extract_activation": "gelu",
|
| 45 |
+
"feat_extract_dropout": 0.0,
|
| 46 |
+
"feat_extract_norm": "group",
|
| 47 |
+
"feat_proj_dropout": 0.1,
|
| 48 |
+
"feat_proj_layer_norm": true,
|
| 49 |
+
"final_dropout": 0.1,
|
| 50 |
+
"gradient_checkpointing": false,
|
| 51 |
+
"hidden_act": "gelu",
|
| 52 |
+
"hidden_dropout": 0.1,
|
| 53 |
+
"hidden_dropout_prob": 0.1,
|
| 54 |
+
"hidden_size": 768,
|
| 55 |
+
"initializer_range": 0.02,
|
| 56 |
+
"intermediate_size": 3072,
|
| 57 |
+
"layer_norm_eps": 1e-05,
|
| 58 |
+
"layerdrop": 0.1,
|
| 59 |
+
"mask_feature_length": 10,
|
| 60 |
+
"mask_feature_min_masks": 0,
|
| 61 |
+
"mask_feature_prob": 0.0,
|
| 62 |
+
"mask_time_length": 10,
|
| 63 |
+
"mask_time_min_masks": 2,
|
| 64 |
+
"mask_time_prob": 0.05,
|
| 65 |
+
"model_type": "hubert",
|
| 66 |
+
"num_attention_heads": 12,
|
| 67 |
+
"num_conv_pos_embedding_groups": 16,
|
| 68 |
+
"num_conv_pos_embeddings": 128,
|
| 69 |
+
"num_feat_extract_layers": 7,
|
| 70 |
+
"num_hidden_layers": 12,
|
| 71 |
+
"pad_token_id": 0,
|
| 72 |
+
"tokenizer_class": "Wav2Vec2CTCTokenizer",
|
| 73 |
+
"transformers_version": "4.57.6",
|
| 74 |
+
"use_weighted_layer_sum": false,
|
| 75 |
+
"vocab_size": 32
|
| 76 |
+
}
|
kmeans_100.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d1b90570ba88813a0193df7465a15ddfef08543e631236afd3b0b43b64cc6c24
|
| 3 |
+
size 307288
|
kmeans_1000.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0aac07a05bb5cd2074378d308ca4284cfe181f1c2dd652a36f6559f79567d5e8
|
| 3 |
+
size 3072096
|
kmeans_200.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cf6202e17618784b42d55566b8ce23cbf2c47549995b5e55fb4626613056ef37
|
| 3 |
+
size 614488
|
kmeans_250.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a28bbb8050b4bd60a3cec9091f9508830420e1bc918e675438102acf3d90bb01
|
| 3 |
+
size 768088
|
kmeans_50.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d7c90180b11bc1a4b5b4d1ce8fe7129593b2c0f53fb448fb3a0c25e3d1611dfd
|
| 3 |
+
size 153688
|
kmeans_500.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8e19582d4c1c40e476a9fd4c405c9e8c923b90536f99a508df2ef8afc72560a1
|
| 3 |
+
size 1536088
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f9940a03529bcdb29b846fd8afb34c5f5bb79ad3548895b138715b5554570be
|
| 3 |
+
size 377510632
|
pint_config.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sample_rate": 16000,
|
| 3 |
+
"frame_stride_ms": 20,
|
| 4 |
+
"hidden_size": 768,
|
| 5 |
+
"base_model": "facebook/hubert-base-ls960",
|
| 6 |
+
"idseq": null,
|
| 7 |
+
"kmeans": {
|
| 8 |
+
"50": "kmeans_50.safetensors",
|
| 9 |
+
"100": "kmeans_100.safetensors",
|
| 10 |
+
"200": "kmeans_200.safetensors",
|
| 11 |
+
"250": "kmeans_250.safetensors",
|
| 12 |
+
"500": "kmeans_500.safetensors",
|
| 13 |
+
"1000": "kmeans_1000.safetensors"
|
| 14 |
+
}
|
| 15 |
+
}
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_normalize": true,
|
| 3 |
+
"feature_extractor_type": "Wav2Vec2FeatureExtractor",
|
| 4 |
+
"feature_size": 1,
|
| 5 |
+
"padding_side": "right",
|
| 6 |
+
"padding_value": 0,
|
| 7 |
+
"return_attention_mask": false,
|
| 8 |
+
"sampling_rate": 16000
|
| 9 |
+
}
|