openlimi commited on
Commit
ebbfa47
·
verified ·
1 Parent(s): e031f9e

Upload Tunar-stt-tiny model from Google Drive

Browse files
README.md ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-stt-tiny
13
+
14
+ Uzbek speech recognition model fine-tuned from Moonshine-tiny (v3_1500h run).
15
+
16
+ - Output alphabet: **new Uzbek Latin alphabet** (`ö ğ ş ç`); convert with `o'->ö, g'->ğ, sh->ş, ch->ç`.
17
+ - Custom 4096-token BPE tokenizer.
18
+ - Input: 16 kHz mono audio, up to ~30 s per segment.
19
+
20
+ ## Usage
21
+ ```python
22
+ import torch, soundfile as sf
23
+ from transformers import MoonshineForConditionalGeneration, AutoTokenizer, AutoFeatureExtractor
24
+
25
+ repo = "openlimi/Tunar-stt-tiny"
26
+ model = MoonshineForConditionalGeneration.from_pretrained(repo).eval()
27
+ tok = AutoTokenizer.from_pretrained(repo)
28
+ fe = AutoFeatureExtractor.from_pretrained(repo)
29
+
30
+ wav, sr = sf.read("audio.wav") # 16 kHz mono
31
+ inputs = fe(wav, sampling_rate=16000, return_tensors="pt", return_attention_mask=True)
32
+ with torch.no_grad():
33
+ ids = model.generate(**inputs, max_new_tokens=int(len(wav) / 16000 * 12) + 8)
34
+ print(tok.batch_decode(ids, skip_special_tokens=True)[0])
35
+ ```
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:cb65079a0d9089513da766ab0734305a8eb0dbed5470fd75a810e7ffb73f3207
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
+ }