juanquivilla commited on
Commit
0ac2ec8
·
verified ·
1 Parent(s): 0fab633

v15: 5-bit MLX quant (237MB, ROUGE-L ~0.955)

Browse files
README.md CHANGED
@@ -1,7 +1,73 @@
1
  ---
2
- language: en
3
- pipeline_tag: text-generation
 
 
4
  tags:
 
 
5
  - mlx
6
- library_name: mlx
 
 
7
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: mit
3
+ language:
4
+ - en
5
+ base_model: juanquivilla/sotto-cleanup-lfm25-350m
6
  tags:
7
+ - speech-to-text
8
+ - transcript-cleanup
9
  - mlx
10
+ - quantized
11
+ - apple-silicon
12
+ pipeline_tag: text-generation
13
  ---
14
+
15
+ # SottoASR Transcript Cleanup — MLX 5-bit (Recommended)
16
+
17
+ 5-bit quantized [MLX](https://github.com/ml-explore/mlx) version of [sotto-cleanup-lfm25-350m](https://huggingface.co/juanquivilla/sotto-cleanup-lfm25-350m) for on-device inference on Apple Silicon Macs.
18
+
19
+ ## Key Specs
20
+
21
+ | Property | Value |
22
+ |----------|-------|
23
+ | **Base model** | juanquivilla/sotto-cleanup-lfm25-350m (v15) |
24
+ | **Quantization** | 5-bit affine, group_size=64 |
25
+ | **Size on disk** | ~237 MB |
26
+ | **Bits per weight** | 5.502 |
27
+ | **ROUGE-L** | ~0.955 (vs 0.960 bf16) |
28
+ | **Inference** | ~50ms on M1 Pro |
29
+
30
+ ## Quantization Recipe
31
+
32
+ ```bash
33
+ mlx_lm.convert \
34
+ --hf-path juanquivilla/sotto-cleanup-lfm25-350m \
35
+ --mlx-path sotto-cleanup-lfm25-350m-mlx-5bit \
36
+ -q --q-bits 5 --q-group-size 64 \
37
+ --trust-remote-code
38
+ ```
39
+
40
+ ## Usage
41
+
42
+ ```python
43
+ from mlx_lm import load, generate
44
+ from mlx_lm.sample_utils import make_sampler
45
+
46
+ model, tokenizer = load("juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit")
47
+ sampler = make_sampler(temp=0.0)
48
+
49
+ text = "so uh basically we need to fix the deployment"
50
+ prompt = f"### Input:\n{text}\n\n### Output:\n"
51
+
52
+ output = generate(model, tokenizer, prompt=prompt, max_tokens=256, sampler=sampler, verbose=False)
53
+ print(output.split("###")[0].strip())
54
+ # → "We need to fix the deployment."
55
+ ```
56
+
57
+ ## Benchmark (bf16 parent model)
58
+
59
+ | Metric | Score |
60
+ |--------|-------|
61
+ | ROUGE-L | 0.960 |
62
+ | Exact Match | 69.6% |
63
+ | Zero-Filler Rate | 88.1% |
64
+
65
+ See [parent model card](https://huggingface.co/juanquivilla/sotto-cleanup-lfm25-350m) for full benchmark breakdown and training details.
66
+
67
+ ## Other Variants
68
+
69
+ | Variant | Size | Repo |
70
+ |---------|------|------|
71
+ | bf16 (full precision) | 676 MB | [sotto-cleanup-lfm25-350m](https://huggingface.co/juanquivilla/sotto-cleanup-lfm25-350m) |
72
+ | **5-bit MLX (this)** | **237 MB** | — |
73
+ | 4-bit MLX | 195 MB | [sotto-cleanup-lfm25-350m-mlx-4bit](https://huggingface.co/juanquivilla/sotto-cleanup-lfm25-350m-mlx-4bit) |
chat_template.jinja ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {{- bos_token -}}{%- set system_prompt = "" -%}{%- set ns = namespace(system_prompt="") -%}{%- if messages[0]["role"] == "system" -%} {%- set ns.system_prompt = messages[0]["content"] -%} {%- set messages = messages[1:] -%}{%- endif -%}{%- if tools -%} {%- set ns.system_prompt = ns.system_prompt + ("
2
+ " if ns.system_prompt else "") + "List of tools: <|tool_list_start|>[" -%} {%- for tool in tools -%} {%- if tool is not string -%} {%- set tool = tool | tojson -%} {%- endif -%} {%- set ns.system_prompt = ns.system_prompt + tool -%} {%- if not loop.last -%} {%- set ns.system_prompt = ns.system_prompt + ", " -%} {%- endif -%} {%- endfor -%} {%- set ns.system_prompt = ns.system_prompt + "]<|tool_list_end|>" -%}{%- endif -%}{%- if ns.system_prompt -%} {{- "<|im_start|>system
3
+ " + ns.system_prompt + "<|im_end|>
4
+ " -}}{%- endif -%}{%- for message in messages -%} {{- "<|im_start|>" + message["role"] + "
5
+ " -}} {%- set content = message["content"] -%} {%- if content is not string -%} {%- set content = content | tojson -%} {%- endif -%} {%- if message["role"] == "tool" -%} {%- set content = "<|tool_response_start|>" + content + "<|tool_response_end|>" -%} {%- endif -%} {{- content + "<|im_end|>
6
+ " -}}{%- endfor -%}{%- if add_generation_prompt -%} {{- "<|im_start|>assistant
7
+ " -}}{%- endif -%}
config.json CHANGED
@@ -18,7 +18,9 @@
18
  "conv_dim": 1024,
19
  "conv_use_xavier_init": true,
20
  "dtype": "bfloat16",
21
- "eos_token_id": 7,
 
 
22
  "hidden_size": 1024,
23
  "initializer_range": 0.02,
24
  "intermediate_size": 6656,
 
18
  "conv_dim": 1024,
19
  "conv_use_xavier_init": true,
20
  "dtype": "bfloat16",
21
+ "eos_token_id": [
22
+ 7
23
+ ],
24
  "hidden_size": 1024,
25
  "initializer_range": 0.02,
26
  "intermediate_size": 6656,
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": [
5
+ 7
6
+ ],
7
+ "pad_token_id": 0,
8
+ "transformers_version": "5.3.0"
9
+ }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c3d11ae83793305087d53be408fa1bfe375c99bceb25fbbe18037ec390bcaa8c
3
  size 243830226
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4e1f08a02244130bc54148e0eb7a4764bf5511d458c9803edfbd33489befec7
3
  size 243830226
tokenizer_config.json CHANGED
@@ -15,6 +15,7 @@
15
  "sp_model_kwargs": {},
16
  "spaces_between_special_tokens": false,
17
  "tokenizer_class": "TokenizersBackend",
 
18
  "use_default_system_prompt": false,
19
  "use_fast": true
20
  }
 
15
  "sp_model_kwargs": {},
16
  "spaces_between_special_tokens": false,
17
  "tokenizer_class": "TokenizersBackend",
18
+ "tool_parser_type": "pythonic",
19
  "use_default_system_prompt": false,
20
  "use_fast": true
21
  }