BaseLayer commited on
Commit
d348e8f
·
verified ·
1 Parent(s): 987711a

Upload TUNAR_v2_mini (best)

Browse files
README.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - uz
4
+ library_name: transformers
5
+ base_model: moonshine-ai/moonshine-tiny
6
+ tags:
7
+ - automatic-speech-recognition
8
+ - moonshine
9
+ - uzbek
10
+ pipeline_tag: automatic-speech-recognition
11
+ ---
12
+ # TUNAR_v1_mini
13
+
14
+ Uzbek speech recognition model fine-tuned from Moonshine-tiny.
15
+
16
+ - Output alphabet: **new Uzbek Latin alphabet** (`ö ğ ş ç`); convert with `o'->ö, g'->ğ, sh->ş, ch->ç`.
17
+ - Custom 4096-token BPE tokenizer (not the original Moonshine tokenizer).
18
+ - Input: 16 kHz mono audio, up to ~30 s per segment.
19
+ - Validation WER: 25.30% (greedy decoding, validation subset)
20
+
21
+ ## Usage
22
+ ```python
23
+ import torch, soundfile as sf
24
+ from transformers import MoonshineForConditionalGeneration, AutoTokenizer, AutoFeatureExtractor
25
+
26
+ repo = "BaseLayer/TUNAR_v2_mini"
27
+ model = MoonshineForConditionalGeneration.from_pretrained(repo).eval()
28
+ tok = AutoTokenizer.from_pretrained(repo)
29
+ fe = AutoFeatureExtractor.from_pretrained(repo)
30
+
31
+ wav, sr = sf.read("audio.wav") # 16 kHz mono
32
+ inputs = fe(wav, sampling_rate=16000, return_tensors="pt", return_attention_mask=True)
33
+ with torch.no_grad():
34
+ ids = model.generate(**inputs, max_new_tokens=int(len(wav) / 16000 * 12) + 8)
35
+ print(tok.batch_decode(ids, skip_special_tokens=True)[0])
36
+ ```
config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MoonshineForConditionalGeneration"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "decoder_hidden_act": "silu",
9
+ "decoder_num_attention_heads": 8,
10
+ "decoder_num_hidden_layers": 6,
11
+ "decoder_num_key_value_heads": 8,
12
+ "decoder_start_token_id": 1,
13
+ "dtype": "float32",
14
+ "encoder_hidden_act": "gelu",
15
+ "encoder_num_attention_heads": 8,
16
+ "encoder_num_hidden_layers": 6,
17
+ "encoder_num_key_value_heads": 8,
18
+ "eos_token_id": 2,
19
+ "hidden_size": 288,
20
+ "initializer_range": 0.02,
21
+ "intermediate_size": 1152,
22
+ "is_encoder_decoder": true,
23
+ "max_position_embeddings": 194,
24
+ "model_type": "moonshine",
25
+ "pad_head_dim_to_multiple_of": 8,
26
+ "pad_token_id": 3,
27
+ "rope_parameters": {
28
+ "partial_rotary_factor": 0.9,
29
+ "rope_theta": 10000.0,
30
+ "rope_type": "default"
31
+ },
32
+ "tie_word_embeddings": true,
33
+ "transformers_version": "5.23.0",
34
+ "use_cache": true,
35
+ "vocab_size": 4096
36
+ }
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "decoder_start_token_id": 1,
5
+ "eos_token_id": 2,
6
+ "max_length": 194,
7
+ "pad_token_id": 3,
8
+ "transformers_version": "5.23.0"
9
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67f8b311b58a384ab0625c094101acc35c4da69eb430d4ff7dd062677057b5ca
3
+ size 75358984
preprocessor_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": false,
3
+ "feature_extractor_type": "Wav2Vec2FeatureExtractor",
4
+ "feature_size": 1,
5
+ "padding_side": "right",
6
+ "padding_value": 0.0,
7
+ "return_attention_mask": true,
8
+ "sampling_rate": 16000
9
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<s>",
4
+ "eos_token": "</s>",
5
+ "model_max_length": 1000000000000000019884624838656,
6
+ "pad_token": "<pad>",
7
+ "tokenizer_class": "TokenizersBackend",
8
+ "unk_token": "<unk>"
9
+ }