Adding Neuron-optimized model files
Browse files🤖 Neuron Export Bot: On behalf of [badaoui](https://huggingface.co/badaoui), adding AWS Neuron-optimized model files.
Neuron-optimized models can achieve high-performance inference on AWS Inferentia and Trainium chips. Learn more:
- [AWS Neuron Documentation](https://awsdocs-neuron.readthedocs-hosted.com)
- [🤗 Optimum Neuron Guide](https://huggingface.co/docs/optimum-neuron/index)
- .gitattributes +1 -0
- README.md +9 -8
- neuron/config.json +135 -0
- neuron/model.neuron +3 -0
- neuron/preprocessor_config.json +9 -0
- neuron/special_tokens_map.json +30 -0
- neuron/tokenizer_config.json +51 -0
- neuron/vocab.json +34 -0
.gitattributes
CHANGED
|
@@ -16,3 +16,4 @@
|
|
| 16 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 17 |
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 18 |
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 16 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 17 |
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 18 |
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
neuron/model.neuron filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -6,6 +6,7 @@ tags:
|
|
| 6 |
- audio
|
| 7 |
- automatic-speech-recognition
|
| 8 |
- hf-asr-leaderboard
|
|
|
|
| 9 |
license: apache-2.0
|
| 10 |
widget:
|
| 11 |
- example_title: Librispeech sample 1
|
|
@@ -16,33 +17,33 @@ model-index:
|
|
| 16 |
- name: wav2vec2-base-960h
|
| 17 |
results:
|
| 18 |
- task:
|
| 19 |
-
name: Automatic Speech Recognition
|
| 20 |
type: automatic-speech-recognition
|
|
|
|
| 21 |
dataset:
|
| 22 |
name: LibriSpeech (clean)
|
| 23 |
type: librispeech_asr
|
| 24 |
config: clean
|
| 25 |
split: test
|
| 26 |
-
args:
|
| 27 |
language: en
|
| 28 |
metrics:
|
| 29 |
-
-
|
| 30 |
-
type: wer
|
| 31 |
value: 3.4
|
|
|
|
| 32 |
- task:
|
| 33 |
-
name: Automatic Speech Recognition
|
| 34 |
type: automatic-speech-recognition
|
|
|
|
| 35 |
dataset:
|
| 36 |
name: LibriSpeech (other)
|
| 37 |
type: librispeech_asr
|
| 38 |
config: other
|
| 39 |
split: test
|
| 40 |
-
args:
|
| 41 |
language: en
|
| 42 |
metrics:
|
| 43 |
-
-
|
| 44 |
-
type: wer
|
| 45 |
value: 8.6
|
|
|
|
| 46 |
---
|
| 47 |
|
| 48 |
# Wav2Vec2-Base-960h
|
|
|
|
| 6 |
- audio
|
| 7 |
- automatic-speech-recognition
|
| 8 |
- hf-asr-leaderboard
|
| 9 |
+
- neuron
|
| 10 |
license: apache-2.0
|
| 11 |
widget:
|
| 12 |
- example_title: Librispeech sample 1
|
|
|
|
| 17 |
- name: wav2vec2-base-960h
|
| 18 |
results:
|
| 19 |
- task:
|
|
|
|
| 20 |
type: automatic-speech-recognition
|
| 21 |
+
name: Automatic Speech Recognition
|
| 22 |
dataset:
|
| 23 |
name: LibriSpeech (clean)
|
| 24 |
type: librispeech_asr
|
| 25 |
config: clean
|
| 26 |
split: test
|
| 27 |
+
args:
|
| 28 |
language: en
|
| 29 |
metrics:
|
| 30 |
+
- type: wer
|
|
|
|
| 31 |
value: 3.4
|
| 32 |
+
name: Test WER
|
| 33 |
- task:
|
|
|
|
| 34 |
type: automatic-speech-recognition
|
| 35 |
+
name: Automatic Speech Recognition
|
| 36 |
dataset:
|
| 37 |
name: LibriSpeech (other)
|
| 38 |
type: librispeech_asr
|
| 39 |
config: other
|
| 40 |
split: test
|
| 41 |
+
args:
|
| 42 |
language: en
|
| 43 |
metrics:
|
| 44 |
+
- type: wer
|
|
|
|
| 45 |
value: 8.6
|
| 46 |
+
name: Test WER
|
| 47 |
---
|
| 48 |
|
| 49 |
# Wav2Vec2-Base-960h
|
neuron/config.json
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_attn_implementation_autoset": true,
|
| 3 |
+
"_name_or_path": "/tmp/tmpk2pjvp1g",
|
| 4 |
+
"activation_dropout": 0.1,
|
| 5 |
+
"adapter_attn_dim": null,
|
| 6 |
+
"adapter_kernel_size": 3,
|
| 7 |
+
"adapter_stride": 2,
|
| 8 |
+
"add_adapter": false,
|
| 9 |
+
"apply_spec_augment": true,
|
| 10 |
+
"architectures": [
|
| 11 |
+
"Wav2Vec2ForCTC"
|
| 12 |
+
],
|
| 13 |
+
"attention_dropout": 0.1,
|
| 14 |
+
"bos_token_id": 1,
|
| 15 |
+
"classifier_proj_size": 256,
|
| 16 |
+
"codevector_dim": 256,
|
| 17 |
+
"contrastive_logits_temperature": 0.1,
|
| 18 |
+
"conv_bias": false,
|
| 19 |
+
"conv_dim": [
|
| 20 |
+
512,
|
| 21 |
+
512,
|
| 22 |
+
512,
|
| 23 |
+
512,
|
| 24 |
+
512,
|
| 25 |
+
512,
|
| 26 |
+
512
|
| 27 |
+
],
|
| 28 |
+
"conv_kernel": [
|
| 29 |
+
10,
|
| 30 |
+
3,
|
| 31 |
+
3,
|
| 32 |
+
3,
|
| 33 |
+
3,
|
| 34 |
+
2,
|
| 35 |
+
2
|
| 36 |
+
],
|
| 37 |
+
"conv_stride": [
|
| 38 |
+
5,
|
| 39 |
+
2,
|
| 40 |
+
2,
|
| 41 |
+
2,
|
| 42 |
+
2,
|
| 43 |
+
2,
|
| 44 |
+
2
|
| 45 |
+
],
|
| 46 |
+
"ctc_loss_reduction": "sum",
|
| 47 |
+
"ctc_zero_infinity": false,
|
| 48 |
+
"diversity_loss_weight": 0.1,
|
| 49 |
+
"do_stable_layer_norm": false,
|
| 50 |
+
"eos_token_id": 2,
|
| 51 |
+
"feat_extract_activation": "gelu",
|
| 52 |
+
"feat_extract_dropout": 0.0,
|
| 53 |
+
"feat_extract_norm": "group",
|
| 54 |
+
"feat_proj_dropout": 0.1,
|
| 55 |
+
"feat_quantizer_dropout": 0.0,
|
| 56 |
+
"final_dropout": 0.1,
|
| 57 |
+
"gradient_checkpointing": false,
|
| 58 |
+
"hidden_act": "gelu",
|
| 59 |
+
"hidden_dropout": 0.1,
|
| 60 |
+
"hidden_dropout_prob": 0.1,
|
| 61 |
+
"hidden_size": 768,
|
| 62 |
+
"initializer_range": 0.02,
|
| 63 |
+
"intermediate_size": 3072,
|
| 64 |
+
"layer_norm_eps": 1e-05,
|
| 65 |
+
"layerdrop": 0.1,
|
| 66 |
+
"mask_feature_length": 10,
|
| 67 |
+
"mask_feature_min_masks": 0,
|
| 68 |
+
"mask_feature_prob": 0.0,
|
| 69 |
+
"mask_time_length": 10,
|
| 70 |
+
"mask_time_min_masks": 2,
|
| 71 |
+
"mask_time_prob": 0.05,
|
| 72 |
+
"model_type": "wav2vec2",
|
| 73 |
+
"neuron": {
|
| 74 |
+
"auto_cast": null,
|
| 75 |
+
"auto_cast_type": null,
|
| 76 |
+
"compiler_type": "neuronx-cc",
|
| 77 |
+
"compiler_version": "2.15.143.0+e39249ad",
|
| 78 |
+
"disable_fallback": false,
|
| 79 |
+
"disable_fast_relayout": false,
|
| 80 |
+
"dynamic_batch_size": false,
|
| 81 |
+
"inline_weights_to_neff": true,
|
| 82 |
+
"input_names": [
|
| 83 |
+
"input_values"
|
| 84 |
+
],
|
| 85 |
+
"model_type": "wav2vec2",
|
| 86 |
+
"optlevel": "2",
|
| 87 |
+
"output_attentions": false,
|
| 88 |
+
"output_hidden_states": false,
|
| 89 |
+
"output_names": [
|
| 90 |
+
"logits"
|
| 91 |
+
],
|
| 92 |
+
"static_audio_sequence_length": 16000,
|
| 93 |
+
"static_batch_size": 1,
|
| 94 |
+
"tensor_parallel_size": 1
|
| 95 |
+
},
|
| 96 |
+
"num_adapter_layers": 3,
|
| 97 |
+
"num_attention_heads": 12,
|
| 98 |
+
"num_codevector_groups": 2,
|
| 99 |
+
"num_codevectors_per_group": 320,
|
| 100 |
+
"num_conv_pos_embedding_groups": 16,
|
| 101 |
+
"num_conv_pos_embeddings": 128,
|
| 102 |
+
"num_feat_extract_layers": 7,
|
| 103 |
+
"num_hidden_layers": 12,
|
| 104 |
+
"num_negatives": 100,
|
| 105 |
+
"output_hidden_size": 768,
|
| 106 |
+
"pad_token_id": 0,
|
| 107 |
+
"proj_codevector_dim": 256,
|
| 108 |
+
"task": "automatic-speech-recognition",
|
| 109 |
+
"tdnn_dilation": [
|
| 110 |
+
1,
|
| 111 |
+
2,
|
| 112 |
+
3,
|
| 113 |
+
1,
|
| 114 |
+
1
|
| 115 |
+
],
|
| 116 |
+
"tdnn_dim": [
|
| 117 |
+
512,
|
| 118 |
+
512,
|
| 119 |
+
512,
|
| 120 |
+
512,
|
| 121 |
+
1500
|
| 122 |
+
],
|
| 123 |
+
"tdnn_kernel": [
|
| 124 |
+
5,
|
| 125 |
+
3,
|
| 126 |
+
3,
|
| 127 |
+
1,
|
| 128 |
+
1
|
| 129 |
+
],
|
| 130 |
+
"torchscript": true,
|
| 131 |
+
"transformers_version": "4.48.3",
|
| 132 |
+
"use_weighted_layer_sum": false,
|
| 133 |
+
"vocab_size": 32,
|
| 134 |
+
"xvector_output_dim": 512
|
| 135 |
+
}
|
neuron/model.neuron
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e7865d731cf4c21bb70d7303cd139ae5a19ea29d60a547f3b4ffd98d2d91d01a
|
| 3 |
+
size 236662391
|
neuron/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.0,
|
| 7 |
+
"return_attention_mask": false,
|
| 8 |
+
"sampling_rate": 16000
|
| 9 |
+
}
|
neuron/special_tokens_map.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<s>",
|
| 4 |
+
"lstrip": true,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": true,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "</s>",
|
| 11 |
+
"lstrip": true,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": true,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "<pad>",
|
| 18 |
+
"lstrip": true,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": true,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"unk_token": {
|
| 24 |
+
"content": "<unk>",
|
| 25 |
+
"lstrip": true,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": true,
|
| 28 |
+
"single_word": false
|
| 29 |
+
}
|
| 30 |
+
}
|
neuron/tokenizer_config.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<pad>",
|
| 5 |
+
"lstrip": true,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": true,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": false
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<s>",
|
| 13 |
+
"lstrip": true,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": true,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": false
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "</s>",
|
| 21 |
+
"lstrip": true,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": true,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": false
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "<unk>",
|
| 29 |
+
"lstrip": true,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": true,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": false
|
| 34 |
+
}
|
| 35 |
+
},
|
| 36 |
+
"bos_token": "<s>",
|
| 37 |
+
"clean_up_tokenization_spaces": false,
|
| 38 |
+
"do_lower_case": false,
|
| 39 |
+
"do_normalize": true,
|
| 40 |
+
"eos_token": "</s>",
|
| 41 |
+
"extra_special_tokens": {},
|
| 42 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 43 |
+
"pad_token": "<pad>",
|
| 44 |
+
"processor_class": "Wav2Vec2Processor",
|
| 45 |
+
"replace_word_delimiter_char": " ",
|
| 46 |
+
"return_attention_mask": false,
|
| 47 |
+
"target_lang": null,
|
| 48 |
+
"tokenizer_class": "Wav2Vec2CTCTokenizer",
|
| 49 |
+
"unk_token": "<unk>",
|
| 50 |
+
"word_delimiter_token": "|"
|
| 51 |
+
}
|
neuron/vocab.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"'": 27,
|
| 3 |
+
"</s>": 2,
|
| 4 |
+
"<pad>": 0,
|
| 5 |
+
"<s>": 1,
|
| 6 |
+
"<unk>": 3,
|
| 7 |
+
"A": 7,
|
| 8 |
+
"B": 24,
|
| 9 |
+
"C": 19,
|
| 10 |
+
"D": 14,
|
| 11 |
+
"E": 5,
|
| 12 |
+
"F": 20,
|
| 13 |
+
"G": 21,
|
| 14 |
+
"H": 11,
|
| 15 |
+
"I": 10,
|
| 16 |
+
"J": 29,
|
| 17 |
+
"K": 26,
|
| 18 |
+
"L": 15,
|
| 19 |
+
"M": 17,
|
| 20 |
+
"N": 9,
|
| 21 |
+
"O": 8,
|
| 22 |
+
"P": 23,
|
| 23 |
+
"Q": 30,
|
| 24 |
+
"R": 13,
|
| 25 |
+
"S": 12,
|
| 26 |
+
"T": 6,
|
| 27 |
+
"U": 16,
|
| 28 |
+
"V": 25,
|
| 29 |
+
"W": 18,
|
| 30 |
+
"X": 28,
|
| 31 |
+
"Y": 22,
|
| 32 |
+
"Z": 31,
|
| 33 |
+
"|": 4
|
| 34 |
+
}
|