Instructions to use mazesmazes/tiny-audio-swift-bundle with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mazesmazes/tiny-audio-swift-bundle with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="mazesmazes/tiny-audio-swift-bundle")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mazesmazes/tiny-audio-swift-bundle", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update bundle from mazesmazes/tiny-audio-embedded
Browse files- .gitattributes +1 -0
- README.md +19 -0
- config.json +41 -0
- decoder.safetensors +3 -0
- decoder_config.json +77 -0
- encoder.safetensors +3 -0
- manifest.json +37 -0
- projector.safetensors +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +20 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# tiny-audio Swift bundle
|
| 2 |
+
|
| 3 |
+
MLX bundle for [tiny-audio-swift](https://github.com/alexkroman/tiny-audio-swift), built from projector [`mazesmazes/tiny-audio-embedded`](https://huggingface.co/mazesmazes/tiny-audio-embedded).
|
| 4 |
+
|
| 5 |
+
## Contents
|
| 6 |
+
- `encoder.safetensors` — GLM-ASR encoder, quantized 8-bit (group 64)
|
| 7 |
+
- `projector.safetensors` — fp16 projector
|
| 8 |
+
- `decoder.safetensors` — MLX-LM decoder
|
| 9 |
+
- `config.json`, `tokenizer.json`, `tokenizer_config.json`, `decoder_config.json`
|
| 10 |
+
- `manifest.json` — sha256 + sizes for all files
|
| 11 |
+
|
| 12 |
+
## Model config
|
| 13 |
+
- Encoder dim: 1280, layers: 32, heads: 20
|
| 14 |
+
- Audio token: `<audio>` (id 151669)
|
| 15 |
+
- Hop length: 160
|
| 16 |
+
- Format version: 1
|
| 17 |
+
|
| 18 |
+
## Usage
|
| 19 |
+
Loaded automatically by tiny-audio-swift's `Transcriber`.
|
config.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"mlx_format_version": 1,
|
| 3 |
+
"encoder": {
|
| 4 |
+
"encoder_dim": 1280,
|
| 5 |
+
"n_mels": 128,
|
| 6 |
+
"num_layers": 32,
|
| 7 |
+
"num_heads": 20,
|
| 8 |
+
"head_dim": 64,
|
| 9 |
+
"intermediate_size": 5120,
|
| 10 |
+
"rope_theta": 10000.0,
|
| 11 |
+
"quantization": {
|
| 12 |
+
"group_size": 64,
|
| 13 |
+
"bits": 8
|
| 14 |
+
}
|
| 15 |
+
},
|
| 16 |
+
"projector": {
|
| 17 |
+
"encoder_dim": 1280,
|
| 18 |
+
"llm_dim": 1024,
|
| 19 |
+
"hidden_dim": 2048,
|
| 20 |
+
"pool_stride": 4
|
| 21 |
+
},
|
| 22 |
+
"audio_token": "<audio>",
|
| 23 |
+
"audio_token_id": 151669,
|
| 24 |
+
"eos_token_ids": [
|
| 25 |
+
151643,
|
| 26 |
+
151645
|
| 27 |
+
],
|
| 28 |
+
"encoder_conv_layers": [
|
| 29 |
+
[
|
| 30 |
+
1,
|
| 31 |
+
3,
|
| 32 |
+
1
|
| 33 |
+
],
|
| 34 |
+
[
|
| 35 |
+
1,
|
| 36 |
+
3,
|
| 37 |
+
2
|
| 38 |
+
]
|
| 39 |
+
],
|
| 40 |
+
"hop_length": 160
|
| 41 |
+
}
|
decoder.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e0af2959045dad826ab3dda66dbece3440d049f6115d6022336b0b52b9afbac8
|
| 3 |
+
size 670516209
|
decoder_config.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"dtype": "float32",
|
| 9 |
+
"eos_token_id": [
|
| 10 |
+
151645,
|
| 11 |
+
151643
|
| 12 |
+
],
|
| 13 |
+
"head_dim": 128,
|
| 14 |
+
"hidden_act": "silu",
|
| 15 |
+
"hidden_size": 1024,
|
| 16 |
+
"initializer_range": 0.02,
|
| 17 |
+
"intermediate_size": 3072,
|
| 18 |
+
"layer_types": [
|
| 19 |
+
"full_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"full_attention"
|
| 47 |
+
],
|
| 48 |
+
"max_position_embeddings": 40960,
|
| 49 |
+
"max_window_layers": 28,
|
| 50 |
+
"model_type": "qwen3",
|
| 51 |
+
"num_attention_heads": 16,
|
| 52 |
+
"num_hidden_layers": 28,
|
| 53 |
+
"num_key_value_heads": 8,
|
| 54 |
+
"pad_token_id": 151643,
|
| 55 |
+
"quantization": {
|
| 56 |
+
"group_size": 64,
|
| 57 |
+
"bits": 8,
|
| 58 |
+
"mode": "affine"
|
| 59 |
+
},
|
| 60 |
+
"quantization_config": {
|
| 61 |
+
"group_size": 64,
|
| 62 |
+
"bits": 8,
|
| 63 |
+
"mode": "affine"
|
| 64 |
+
},
|
| 65 |
+
"rms_norm_eps": 1e-06,
|
| 66 |
+
"rope_parameters": {
|
| 67 |
+
"rope_theta": 1000000,
|
| 68 |
+
"rope_type": "default"
|
| 69 |
+
},
|
| 70 |
+
"rope_theta": 1000000.0,
|
| 71 |
+
"sliding_window": null,
|
| 72 |
+
"tie_word_embeddings": true,
|
| 73 |
+
"transformers_version": "5.7.0",
|
| 74 |
+
"use_cache": false,
|
| 75 |
+
"use_sliding_window": false,
|
| 76 |
+
"vocab_size": 151670
|
| 77 |
+
}
|
encoder.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:40ae3b9cdc513670685eec797168a80a78dd9808ea5a10e25177e03213cf063e
|
| 3 |
+
size 682529665
|
manifest.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"format_version": 1,
|
| 3 |
+
"files": {
|
| 4 |
+
"tokenizer_config.json": {
|
| 5 |
+
"sha256": "2b682cdd791448785caf44a1da2bafffdecaaf88ae6654fd8c3b59cc3b7470ab",
|
| 6 |
+
"size": 4766
|
| 7 |
+
},
|
| 8 |
+
"decoder_config.json": {
|
| 9 |
+
"sha256": "a8374eef7dacf1580738fd8ddc1f7e0b9e948866e1dd0d044f17eb85a3a42014",
|
| 10 |
+
"size": 1865
|
| 11 |
+
},
|
| 12 |
+
"config.json": {
|
| 13 |
+
"sha256": "c63e8bf5ea9b76fbcd734694d62e2b75ba6d6483fd2881cd18b00b71b2ab76bf",
|
| 14 |
+
"size": 630
|
| 15 |
+
},
|
| 16 |
+
"tokenizer.json": {
|
| 17 |
+
"sha256": "33b674fb8444e2553eae8f1b261093371920a28ef75b5c18f4deb3f9217ed0ba",
|
| 18 |
+
"size": 11422834
|
| 19 |
+
},
|
| 20 |
+
"README.md": {
|
| 21 |
+
"sha256": "c38020c601a9d28abb1dc01661161ffb0a3c8cf362ce2bec029aeaa53437115b",
|
| 22 |
+
"size": 928
|
| 23 |
+
},
|
| 24 |
+
"projector.safetensors": {
|
| 25 |
+
"sha256": "44e021cee2070bffabf612ff1f02028f58948dc854ad69b743bc8847314a9f04",
|
| 26 |
+
"size": 50344282
|
| 27 |
+
},
|
| 28 |
+
"encoder.safetensors": {
|
| 29 |
+
"sha256": "40ae3b9cdc513670685eec797168a80a78dd9808ea5a10e25177e03213cf063e",
|
| 30 |
+
"size": 682529665
|
| 31 |
+
},
|
| 32 |
+
"decoder.safetensors": {
|
| 33 |
+
"sha256": "e0af2959045dad826ab3dda66dbece3440d049f6115d6022336b0b52b9afbac8",
|
| 34 |
+
"size": 670516209
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
}
|
projector.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44e021cee2070bffabf612ff1f02028f58948dc854ad69b743bc8847314a9f04
|
| 3 |
+
size 50344282
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:33b674fb8444e2553eae8f1b261093371920a28ef75b5c18f4deb3f9217ed0ba
|
| 3 |
+
size 11422834
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<audio>"
|
| 10 |
+
],
|
| 11 |
+
"is_local": true,
|
| 12 |
+
"local_files_only": false,
|
| 13 |
+
"model_max_length": 131072,
|
| 14 |
+
"pad_token": "<|endoftext|>",
|
| 15 |
+
"split_special_tokens": false,
|
| 16 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 17 |
+
"tool_parser_type": "json_tools",
|
| 18 |
+
"unk_token": null,
|
| 19 |
+
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if true %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}"
|
| 20 |
+
}
|