Vurtnec commited on
Commit
d288bcb
·
verified ·
1 Parent(s): e51acd7

Upload V4 fine-tuned ONNX model

Browse files
README.md ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - turn-detection
5
+ - end-of-utterance
6
+ - voice-agent
7
+ - livekit
8
+ - onnx
9
+ ---
10
+
11
+ # Turn Detector V4 (Fine-tuned)
12
+
13
+ This is a fine-tuned version of the LiveKit Turn Detector model, optimized for specific production use cases.
14
+
15
+ ## Model Description
16
+
17
+ - **Base Model**: Qwen2-0.5B-Instruct
18
+ - **Task**: End-of-Utterance (EOU) detection for voice agents
19
+ - **Format**: ONNX (INT8 quantized)
20
+ - **Fine-tuning Method**: LoRA (Low-Rank Adaptation)
21
+ - **Training Data**: 1735 production conversation records
22
+
23
+ ## Performance
24
+
25
+ - **Accuracy**: 79.25% @ threshold 0.38
26
+ - **Dataset**: 1735 annotated production records
27
+ - **Improvement**: +13.08% over LiveKit v1.2.2-en baseline
28
+
29
+ ## Usage
30
+
31
+ ```python
32
+ from livekit.agents import turn_detector
33
+
34
+ # Use with LiveKit agents
35
+ detector = turn_detector.EOUModel.load(
36
+ model_id="Vurtnec/turn-detector",
37
+ download_files=["model.onnx"]
38
+ )
39
+ ```
40
+
41
+ ## Model Files
42
+
43
+ - `model.onnx`: ONNX Runtime optimized model (250MB)
44
+ - Tokenizer files: Standard Qwen2 tokenizer configuration
45
+
46
+ ## Training Details
47
+
48
+ - **Base Model**: LiveKit Turn Detector v1.2.2-en
49
+ - **Fine-tuning Approach**: LoRA with rank=8, alpha=16
50
+ - **Training Dataset**: 1735 production EOU examples
51
+ - **Validation Split**: 10%
52
+ - **Training Date**: December 2024
53
+
54
+ ## Citation
55
+
56
+ If you use this model, please cite:
57
+
58
+ ```bibtex
59
+ @misc{turn-detector-v4,
60
+ author = {Vurtnec},
61
+ title = {Turn Detector V4 - Fine-tuned EOU Model},
62
+ year = {2024},
63
+ publisher = {HuggingFace},
64
+ howpublished = {\url{https://huggingface.co/Vurtnec/turn-detector}}
65
+ }
66
+ ```
67
+
68
+ ## License
69
+
70
+ Apache 2.0
added_tokens.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "<|assistant|>": 49153,
3
+ "<|pad|>": 49154,
4
+ "<|user|>": 49152
5
+ }
chat_template.jinja ADDED
@@ -0,0 +1 @@
 
 
1
+ {% for message in messages %}{{'<|im_start|>' + '<|' + message['role'] + '|>' + message['content'] + '<|im_end|>'}}{% endfor %}
config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen2ForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 151643,
7
+ "eos_token_id": 151645,
8
+ "hidden_act": "silu",
9
+ "hidden_size": 896,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 4864,
12
+ "max_position_embeddings": 32768,
13
+ "max_window_layers": 21,
14
+ "model_type": "qwen2",
15
+ "num_attention_heads": 14,
16
+ "num_hidden_layers": 24,
17
+ "num_key_value_heads": 2,
18
+ "rms_norm_eps": 1e-06,
19
+ "rope_theta": 1000000.0,
20
+ "sliding_window": 32768,
21
+ "tie_word_embeddings": true,
22
+ "torch_dtype": "bfloat16",
23
+ "transformers_version": "4.37.2",
24
+ "use_cache": true,
25
+ "use_sliding_window": false,
26
+ "vocab_size": 151936
27
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7722e7cab7507e0ee5070adcd7cbc3c994edc3c11a098f1015cf43ef332f6b0
3
+ size 262102331
ort_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "opset": 17,
3
+ "optimization": {
4
+ "enable_gelu_approximation": false,
5
+ "enable_gemm_fast_gelu": false,
6
+ "enable_layer_norm": true,
7
+ "enable_skip_layer_norm": true,
8
+ "enable_bias_skip_layer_norm": true,
9
+ "enable_bias_gelu": true,
10
+ "enable_gelu": true,
11
+ "enable_attention": true,
12
+ "use_multi_head_attention": true,
13
+ "enable_skip_simplified_layer_norm": true
14
+ },
15
+ "quantization": {
16
+ "format": "QOperator",
17
+ "mode": "IntegerOps",
18
+ "per_channel": false,
19
+ "reduce_range": true,
20
+ "weight_type": "QInt8"
21
+ }
22
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>",
5
+ "<|user|>",
6
+ "<|assistant|>",
7
+ "<|pad|>"
8
+ ],
9
+ "bos_token": {
10
+ "content": "<|endoftext|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "<|endoftext|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "pad_token": {
24
+ "content": "<|pad|>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "<|endoftext|>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<|im_start|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "<|im_end|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<repo_name>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "4": {
37
+ "content": "<reponame>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "5": {
45
+ "content": "<file_sep>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "6": {
53
+ "content": "<filename>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "7": {
61
+ "content": "<gh_stars>",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "8": {
69
+ "content": "<issue_start>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "9": {
77
+ "content": "<issue_comment>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "10": {
85
+ "content": "<issue_closed>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "11": {
93
+ "content": "<jupyter_start>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ },
100
+ "12": {
101
+ "content": "<jupyter_text>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": true
107
+ },
108
+ "13": {
109
+ "content": "<jupyter_code>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": true
115
+ },
116
+ "14": {
117
+ "content": "<jupyter_output>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": true
123
+ },
124
+ "15": {
125
+ "content": "<jupyter_script>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": true
131
+ },
132
+ "16": {
133
+ "content": "<empty_output>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": true
139
+ },
140
+ "49152": {
141
+ "content": "<|user|>",
142
+ "lstrip": false,
143
+ "normalized": false,
144
+ "rstrip": false,
145
+ "single_word": false,
146
+ "special": true
147
+ },
148
+ "49153": {
149
+ "content": "<|assistant|>",
150
+ "lstrip": false,
151
+ "normalized": false,
152
+ "rstrip": false,
153
+ "single_word": false,
154
+ "special": true
155
+ },
156
+ "49154": {
157
+ "content": "<|pad|>",
158
+ "lstrip": false,
159
+ "normalized": false,
160
+ "rstrip": false,
161
+ "single_word": false,
162
+ "special": true
163
+ }
164
+ },
165
+ "additional_special_tokens": [
166
+ "<|im_start|>",
167
+ "<|im_end|>",
168
+ "<|user|>",
169
+ "<|assistant|>",
170
+ "<|pad|>"
171
+ ],
172
+ "bos_token": "<|endoftext|>",
173
+ "clean_up_tokenization_spaces": false,
174
+ "eos_token": "<|endoftext|>",
175
+ "extra_special_tokens": {},
176
+ "model_max_length": 8192,
177
+ "pad_token": "<|pad|>",
178
+ "tokenizer_class": "GPT2Tokenizer",
179
+ "truncation_side": "left",
180
+ "unk_token": "<|endoftext|>",
181
+ "vocab_size": 49152
182
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff