RanenSim commited on
Commit
319d77e
·
verified ·
1 Parent(s): de36318

Upload 17 files

Browse files
.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
+ LLM/tokenizer.json filter=lfs diff=lfs merge=lfs -text
ASR/README.md ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: other
5
+ tags:
6
+ - whisper
7
+ - ctranslate2
8
+ - automatic-speech-recognition
9
+ - air-traffic-control
10
+ - atc
11
+ - singapore
12
+ - military
13
+ - faster-whisper
14
+ base_model: jacktol/whisper-large-v3-finetuned-for-ATC
15
+ pipeline_tag: automatic-speech-recognition
16
+ metrics:
17
+ - wer
18
+ model-index:
19
+ - name: whisper-large-v3-atc-singapore
20
+ results:
21
+ - task:
22
+ type: automatic-speech-recognition
23
+ metrics:
24
+ - name: WER
25
+ type: wer
26
+ value: 0.24
27
+ ---
28
+
29
+ # Whisper Large v3 — Singapore Military ATC (CTranslate2 float16)
30
+
31
+ Fine-tuned Whisper Large v3 for Singapore Air Force air traffic control speech recognition.
32
+
33
+ ## Performance
34
+
35
+ | Run | WER | Data | Key Change |
36
+ |-----|-----|------|------------|
37
+ | ct2_run5 | 0.48% | 6,680 synthetic | Baseline fine-tune |
38
+ | ct2_run6 | 0.40% | 6,680 synthetic | +augmentation, weight decay |
39
+ | **ct2_run7** | **0.24%** | 6,730 (synthetic + real) | +50 real recordings, frozen encoder |
40
+
41
+ ## Model Details
42
+
43
+ | Key | Value |
44
+ |-----|-------|
45
+ | Base model | `jacktol/whisper-large-v3-finetuned-for-ATC` |
46
+ | Format | CTranslate2 float16 |
47
+ | Size | 2.9 GB |
48
+ | Best WER | 0.24% (epoch 1) |
49
+ | Domain | Singapore military ATC (Tengah WSAT, Paya Lebar WSAP) |
50
+
51
+ ## Training
52
+
53
+ - **Continued training** from ct2_run6 best checkpoint (WER 0.40%)
54
+ - **Encoder frozen** — only decoder fine-tuned to preserve acoustic features
55
+ - Learning rate: 2e-6 (4x lower than run6)
56
+ - Optimizer: AdamW 8-bit
57
+ - Effective batch size: 16
58
+ - Mixed precision: fp16
59
+ - Early stopping: patience 2
60
+
61
+ ### Dataset
62
+
63
+ - 6,680 synthetic entries (1,670 phrases x 4 TTS voice variants)
64
+ - 50 real human recordings (20x oversampled = 1,000 effective entries)
65
+ - Total: 6,730 entries
66
+
67
+ ### Augmentation
68
+
69
+ Gaussian noise, time stretch, band-pass filter (300-3400 Hz VHF simulation), random clip, MP3 compression, SpecAugment, random silence padding.
70
+
71
+ ## Usage
72
+
73
+ ```python
74
+ from faster_whisper import WhisperModel
75
+
76
+ model = WhisperModel("path/to/ASR", device="cuda", compute_type="float16")
77
+ segments, info = model.transcribe(
78
+ "audio.wav",
79
+ language="en",
80
+ beam_size=5,
81
+ hotwords="tengah paya lebar tacan sinjon pandan tuas murai seletar sembawang",
82
+ )
83
+ text = " ".join(seg.text.strip() for seg in segments)
84
+ # "camel cleared i l s approach runway three six"
85
+ ```
86
+
87
+ ## Output Format
88
+
89
+ The model outputs **normalized spoken text** (lowercase, fully expanded):
90
+
91
+ | Input audio says | Model outputs |
92
+ |-----------------|---------------|
93
+ | "CAMEL climb flight level zero nine zero" | `camel climb flight level zero nine zero` |
94
+ | "Contact Tengah Approach one three zero decimal zero" | `contact tengah approach one three zero decimal zero` |
95
+ | "Squawk seven seven zero zero" | `squawk seven seven zero zero` |
96
+
97
+ Use the companion LLM formatter to convert to display text (e.g., `CAMEL climb FL090`).
ASR/config.json ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alignment_heads": [
3
+ [
4
+ 7,
5
+ 0
6
+ ],
7
+ [
8
+ 10,
9
+ 17
10
+ ],
11
+ [
12
+ 12,
13
+ 18
14
+ ],
15
+ [
16
+ 13,
17
+ 12
18
+ ],
19
+ [
20
+ 16,
21
+ 1
22
+ ],
23
+ [
24
+ 17,
25
+ 14
26
+ ],
27
+ [
28
+ 19,
29
+ 11
30
+ ],
31
+ [
32
+ 21,
33
+ 4
34
+ ],
35
+ [
36
+ 24,
37
+ 1
38
+ ],
39
+ [
40
+ 25,
41
+ 6
42
+ ]
43
+ ],
44
+ "lang_ids": [
45
+ 50259,
46
+ 50260,
47
+ 50261,
48
+ 50262,
49
+ 50263,
50
+ 50264,
51
+ 50265,
52
+ 50266,
53
+ 50267,
54
+ 50268,
55
+ 50269,
56
+ 50270,
57
+ 50271,
58
+ 50272,
59
+ 50273,
60
+ 50274,
61
+ 50275,
62
+ 50276,
63
+ 50277,
64
+ 50278,
65
+ 50279,
66
+ 50280,
67
+ 50281,
68
+ 50282,
69
+ 50283,
70
+ 50284,
71
+ 50285,
72
+ 50286,
73
+ 50287,
74
+ 50288,
75
+ 50289,
76
+ 50290,
77
+ 50291,
78
+ 50292,
79
+ 50293,
80
+ 50294,
81
+ 50295,
82
+ 50296,
83
+ 50297,
84
+ 50298,
85
+ 50299,
86
+ 50300,
87
+ 50301,
88
+ 50302,
89
+ 50303,
90
+ 50304,
91
+ 50305,
92
+ 50306,
93
+ 50307,
94
+ 50308,
95
+ 50309,
96
+ 50310,
97
+ 50311,
98
+ 50312,
99
+ 50313,
100
+ 50314,
101
+ 50315,
102
+ 50316,
103
+ 50317,
104
+ 50318,
105
+ 50319,
106
+ 50320,
107
+ 50321,
108
+ 50322,
109
+ 50323,
110
+ 50324,
111
+ 50325,
112
+ 50326,
113
+ 50327,
114
+ 50328,
115
+ 50329,
116
+ 50330,
117
+ 50331,
118
+ 50332,
119
+ 50333,
120
+ 50334,
121
+ 50335,
122
+ 50336,
123
+ 50337,
124
+ 50338,
125
+ 50339,
126
+ 50340,
127
+ 50341,
128
+ 50342,
129
+ 50343,
130
+ 50344,
131
+ 50345,
132
+ 50346,
133
+ 50347,
134
+ 50348,
135
+ 50349,
136
+ 50350,
137
+ 50351,
138
+ 50352,
139
+ 50353,
140
+ 50354,
141
+ 50355,
142
+ 50356,
143
+ 50357,
144
+ 50358
145
+ ],
146
+ "suppress_ids": [],
147
+ "suppress_ids_begin": [
148
+ 220
149
+ ]
150
+ }
ASR/model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0be75c051de8f101137150567f68e66f79ed2f37f7fa3bd925576f74ff01fb3
3
+ size 3087284237
ASR/preprocessor_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "chunk_length": 30,
3
+ "dither": 0.0,
4
+ "feature_extractor_type": "WhisperFeatureExtractor",
5
+ "feature_size": 128,
6
+ "hop_length": 160,
7
+ "n_fft": 400,
8
+ "n_samples": 480000,
9
+ "nb_max_frames": 3000,
10
+ "padding_side": "right",
11
+ "padding_value": 0.0,
12
+ "processor_class": "WhisperProcessor",
13
+ "return_attention_mask": false,
14
+ "sampling_rate": 16000
15
+ }
ASR/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
ASR/vocabulary.json ADDED
The diff for this file is too large to render. See raw diff
 
LLM/README.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: other
5
+ tags:
6
+ - qwen3
7
+ - text-generation
8
+ - text2text-generation
9
+ - air-traffic-control
10
+ - atc
11
+ - singapore
12
+ - military
13
+ - lora
14
+ - unsloth
15
+ base_model: unsloth/Qwen3-1.7B
16
+ ---
17
+
18
+ # Qwen3-1.7B — ATC Display Text Formatter
19
+
20
+ Fine-tuned Qwen3-1.7B that converts normalized ASR output into structured ATC display text. Designed to work downstream of the companion Whisper ASR model.
21
+
22
+ ## Performance
23
+
24
+ | Metric | Value |
25
+ |--------|-------|
26
+ | Exact match accuracy | **100.0%** (161/161) |
27
+ | Avg character edit distance | 0.0 |
28
+ | Best eval loss | 0.0005 |
29
+
30
+ ## Model Details
31
+
32
+ | Key | Value |
33
+ |-----|-------|
34
+ | Base model | `unsloth/Qwen3-1.7B` |
35
+ | Method | bf16 LoRA (rank 16, alpha 32) |
36
+ | Merged size | 3.3 GB |
37
+ | Train examples | 1,915 |
38
+ | Eval examples | 161 |
39
+ | Thinking mode | Disabled |
40
+
41
+ ## Training
42
+
43
+ - Framework: Unsloth + SFTTrainer (trl)
44
+ - Optimizer: AdamW 8-bit
45
+ - Learning rate: 1.2e-4
46
+ - Effective batch size: 16
47
+ - Precision: bf16
48
+ - Packing: enabled
49
+ - Train on responses only: yes
50
+ - Converged at step 380 (epoch 3.2)
51
+
52
+ ### Dataset
53
+
54
+ 1,670 unique ATC phrases from `axite.json`, stratified 90/10 split by category. Includes ASR noise augmentation (simulated ASR errors) for robustness.
55
+
56
+ ## What It Does
57
+
58
+ Converts normalized spoken text (ASR output) into structured display text:
59
+
60
+ | Input (normalized) | Output (display) |
61
+ |-------------------|-----------------|
62
+ | `camel climb flight level zero nine zero` | `CAMEL climb FL090` |
63
+ | `contact tengah approach one three zero decimal zero` | `contact Tengah Approach 130.0` |
64
+ | `squawk seven seven zero zero` | `squawk 7700` |
65
+ | `request clearance, ninja two f sixteens for western coast departure for i l s.` | `Request clearance, NINJA 2xF16 for Western Coast Departure for ILS.` |
66
+
67
+ ## Usage
68
+
69
+ ```python
70
+ from transformers import AutoModelForCausalLM, AutoTokenizer
71
+
72
+ model = AutoModelForCausalLM.from_pretrained("path/to/LLM", torch_dtype="auto", device_map="auto")
73
+ tokenizer = AutoTokenizer.from_pretrained("path/to/LLM")
74
+
75
+ messages = [
76
+ {"role": "system", "content": "Convert the following air traffic control transcript into structured display text."},
77
+ {"role": "user", "content": "camel climb flight level zero nine zero"},
78
+ ]
79
+ text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
80
+ inputs = tokenizer(text, return_tensors="pt").to(model.device)
81
+ outputs = model.generate(**inputs, max_new_tokens=128, temperature=0.3, top_p=0.9, top_k=30)
82
+ result = tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True)
83
+ # "CAMEL climb FL090"
84
+ ```
85
+
86
+ ## Inference Settings
87
+
88
+ | Parameter | Value |
89
+ |-----------|-------|
90
+ | Temperature | 0.3 |
91
+ | Top-p | 0.9 |
92
+ | Top-k | 30 |
93
+ | Max new tokens | 128 |
94
+ | Thinking | Disabled (`enable_thinking=False`) |
LLM/added_tokens.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "</think>": 151668,
3
+ "</tool_call>": 151658,
4
+ "</tool_response>": 151666,
5
+ "<think>": 151667,
6
+ "<tool_call>": 151657,
7
+ "<tool_response>": 151665,
8
+ "<|PAD_TOKEN|>": 151669,
9
+ "<|box_end|>": 151649,
10
+ "<|box_start|>": 151648,
11
+ "<|endoftext|>": 151643,
12
+ "<|file_sep|>": 151664,
13
+ "<|fim_middle|>": 151660,
14
+ "<|fim_pad|>": 151662,
15
+ "<|fim_prefix|>": 151659,
16
+ "<|fim_suffix|>": 151661,
17
+ "<|im_end|>": 151645,
18
+ "<|im_start|>": 151644,
19
+ "<|image_pad|>": 151655,
20
+ "<|object_ref_end|>": 151647,
21
+ "<|object_ref_start|>": 151646,
22
+ "<|quad_end|>": 151651,
23
+ "<|quad_start|>": 151650,
24
+ "<|repo_name|>": 151663,
25
+ "<|video_pad|>": 151656,
26
+ "<|vision_end|>": 151653,
27
+ "<|vision_pad|>": 151654,
28
+ "<|vision_start|>": 151652
29
+ }
LLM/chat_template.jinja ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {{- messages[0].content + '\n\n' }}
5
+ {%- endif %}
6
+ {{- "# 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>" }}
7
+ {%- for tool in tools %}
8
+ {{- "\n" }}
9
+ {{- tool | tojson }}
10
+ {%- endfor %}
11
+ {{- "\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" }}
12
+ {%- else %}
13
+ {%- if messages[0].role == 'system' %}
14
+ {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
+ {%- endif %}
16
+ {%- endif %}
17
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
18
+ {%- for forward_message in messages %}
19
+ {%- set index = (messages|length - 1) - loop.index0 %}
20
+ {%- set message = messages[index] %}
21
+ {%- set current_content = message.content if message.content is not none else '' %}
22
+ {%- set tool_start = '<tool_response>' %}
23
+ {%- set tool_start_length = tool_start|length %}
24
+ {%- set start_of_message = current_content[:tool_start_length] %}
25
+ {%- set tool_end = '</tool_response>' %}
26
+ {%- set tool_end_length = tool_end|length %}
27
+ {%- set start_pos = (current_content|length) - tool_end_length %}
28
+ {%- if start_pos < 0 %}
29
+ {%- set start_pos = 0 %}
30
+ {%- endif %}
31
+ {%- set end_of_message = current_content[start_pos:] %}
32
+ {%- if ns.multi_step_tool and message.role == "user" and not(start_of_message == tool_start and end_of_message == tool_end) %}
33
+ {%- set ns.multi_step_tool = false %}
34
+ {%- set ns.last_query_index = index %}
35
+ {%- endif %}
36
+ {%- endfor %}
37
+ {%- for message in messages %}
38
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
39
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
40
+ {%- elif message.role == "assistant" %}
41
+ {%- set content = message.content %}
42
+ {%- set reasoning_content = '' %}
43
+ {%- if message.reasoning_content is defined and message.reasoning_content is not none %}
44
+ {%- set reasoning_content = message.reasoning_content %}
45
+ {%- else %}
46
+ {%- if '</think>' in message.content %}
47
+ {%- set content = (message.content.split('</think>')|last).lstrip('\n') %}
48
+ {%- set reasoning_content = (message.content.split('</think>')|first).rstrip('\n') %}
49
+ {%- set reasoning_content = (reasoning_content.split('<think>')|last).lstrip('\n') %}
50
+ {%- endif %}
51
+ {%- endif %}
52
+ {%- if loop.index0 > ns.last_query_index %}
53
+ {%- if loop.last or (not loop.last and reasoning_content) %}
54
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
55
+ {%- else %}
56
+ {{- '<|im_start|>' + message.role + '\n' + content }}
57
+ {%- endif %}
58
+ {%- else %}
59
+ {{- '<|im_start|>' + message.role + '\n' + content }}
60
+ {%- endif %}
61
+ {%- if message.tool_calls %}
62
+ {%- for tool_call in message.tool_calls %}
63
+ {%- if (loop.first and content) or (not loop.first) %}
64
+ {{- '\n' }}
65
+ {%- endif %}
66
+ {%- if tool_call.function %}
67
+ {%- set tool_call = tool_call.function %}
68
+ {%- endif %}
69
+ {{- '<tool_call>\n{"name": "' }}
70
+ {{- tool_call.name }}
71
+ {{- '", "arguments": ' }}
72
+ {%- if tool_call.arguments is string %}
73
+ {{- tool_call.arguments }}
74
+ {%- else %}
75
+ {{- tool_call.arguments | tojson }}
76
+ {%- endif %}
77
+ {{- '}\n</tool_call>' }}
78
+ {%- endfor %}
79
+ {%- endif %}
80
+ {{- '<|im_end|>\n' }}
81
+ {%- elif message.role == "tool" %}
82
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
83
+ {{- '<|im_start|>user' }}
84
+ {%- endif %}
85
+ {{- '\n<tool_response>\n' }}
86
+ {{- message.content }}
87
+ {{- '\n</tool_response>' }}
88
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
89
+ {{- '<|im_end|>\n' }}
90
+ {%- endif %}
91
+ {%- endif %}
92
+ {%- endfor %}
93
+ {%- if add_generation_prompt %}
94
+ {{- '<|im_start|>assistant\n' }}
95
+ {%- if enable_thinking is defined and enable_thinking is false %}
96
+ {{- '<think>\n\n</think>\n\n' }}
97
+ {%- endif %}
98
+ {%- endif %}
LLM/config.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "torch_dtype": "bfloat16",
8
+ "eos_token_id": 151645,
9
+ "head_dim": 128,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 2048,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 6144,
14
+ "layer_types": [
15
+ "full_attention",
16
+ "full_attention",
17
+ "full_attention",
18
+ "full_attention",
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
+ ],
44
+ "max_position_embeddings": 40960,
45
+ "max_window_layers": 28,
46
+ "model_type": "qwen3",
47
+ "num_attention_heads": 16,
48
+ "num_hidden_layers": 28,
49
+ "num_key_value_heads": 8,
50
+ "pad_token_id": 151669,
51
+ "rms_norm_eps": 1e-06,
52
+ "rope_scaling": null,
53
+ "rope_theta": 1000000,
54
+ "sliding_window": null,
55
+ "tie_word_embeddings": true,
56
+ "unsloth_fixed": true,
57
+ "unsloth_version": "2026.3.4",
58
+ "use_cache": true,
59
+ "use_sliding_window": false,
60
+ "vocab_size": 151936
61
+ }
LLM/merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
LLM/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e64afd87fbd8688bc16b711911525c1a831b3718c6cad489c05deceb07c4783d
3
+ size 3441185608
LLM/special_tokens_map.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>",
5
+ "<|object_ref_start|>",
6
+ "<|object_ref_end|>",
7
+ "<|box_start|>",
8
+ "<|box_end|>",
9
+ "<|quad_start|>",
10
+ "<|quad_end|>",
11
+ "<|vision_start|>",
12
+ "<|vision_end|>",
13
+ "<|vision_pad|>",
14
+ "<|image_pad|>",
15
+ "<|video_pad|>"
16
+ ],
17
+ "eos_token": {
18
+ "content": "<|im_end|>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ },
24
+ "pad_token": "<|PAD_TOKEN|>"
25
+ }
LLM/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10ba4ba91270b1a50e5cd8e51023bccc66fc4ac4909dd7ae7ab29433411c9bb9
3
+ size 11422844
LLM/tokenizer_config.json ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "151643": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "151644": {
14
+ "content": "<|im_start|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "151645": {
22
+ "content": "<|im_end|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "151646": {
30
+ "content": "<|object_ref_start|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "151647": {
38
+ "content": "<|object_ref_end|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "151648": {
46
+ "content": "<|box_start|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "151649": {
54
+ "content": "<|box_end|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "151650": {
62
+ "content": "<|quad_start|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "151651": {
70
+ "content": "<|quad_end|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "151652": {
78
+ "content": "<|vision_start|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "151653": {
86
+ "content": "<|vision_end|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "151654": {
94
+ "content": "<|vision_pad|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "151655": {
102
+ "content": "<|image_pad|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "151656": {
110
+ "content": "<|video_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "151657": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "151658": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "151659": {
134
+ "content": "<|fim_prefix|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "151660": {
142
+ "content": "<|fim_middle|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "151661": {
150
+ "content": "<|fim_suffix|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "151662": {
158
+ "content": "<|fim_pad|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "151663": {
166
+ "content": "<|repo_name|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "151664": {
174
+ "content": "<|file_sep|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ },
181
+ "151665": {
182
+ "content": "<tool_response>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": false
188
+ },
189
+ "151666": {
190
+ "content": "</tool_response>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": false
196
+ },
197
+ "151667": {
198
+ "content": "<think>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": false
204
+ },
205
+ "151668": {
206
+ "content": "</think>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": false
212
+ },
213
+ "151669": {
214
+ "content": "<|PAD_TOKEN|>",
215
+ "lstrip": false,
216
+ "normalized": false,
217
+ "rstrip": false,
218
+ "single_word": false,
219
+ "special": true
220
+ }
221
+ },
222
+ "additional_special_tokens": [
223
+ "<|im_start|>",
224
+ "<|im_end|>",
225
+ "<|object_ref_start|>",
226
+ "<|object_ref_end|>",
227
+ "<|box_start|>",
228
+ "<|box_end|>",
229
+ "<|quad_start|>",
230
+ "<|quad_end|>",
231
+ "<|vision_start|>",
232
+ "<|vision_end|>",
233
+ "<|vision_pad|>",
234
+ "<|image_pad|>",
235
+ "<|video_pad|>"
236
+ ],
237
+ "bos_token": null,
238
+ "clean_up_tokenization_spaces": false,
239
+ "eos_token": "<|im_end|>",
240
+ "errors": "replace",
241
+ "extra_special_tokens": {},
242
+ "model_max_length": 40960,
243
+ "pad_token": "<|PAD_TOKEN|>",
244
+ "padding_side": "left",
245
+ "split_special_tokens": false,
246
+ "tokenizer_class": "Qwen2Tokenizer",
247
+ "unk_token": null,
248
+ "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 forward_message in messages %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- set message = messages[index] %}\n {%- set current_content = message.content if message.content is not none else '' %}\n {%- set tool_start = '<tool_response>' %}\n {%- set tool_start_length = tool_start|length %}\n {%- set start_of_message = current_content[:tool_start_length] %}\n {%- set tool_end = '</tool_response>' %}\n {%- set tool_end_length = tool_end|length %}\n {%- set start_pos = (current_content|length) - tool_end_length %}\n {%- if start_pos < 0 %}\n {%- set start_pos = 0 %}\n {%- endif %}\n {%- set end_of_message = current_content[start_pos:] %}\n {%- if ns.multi_step_tool and message.role == \"user\" and not(start_of_message == tool_start and end_of_message == tool_end) %}\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.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set content = message.content %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is defined and message.reasoning_content is not none %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in message.content %}\n {%- set content = (message.content.split('</think>')|last).lstrip('\\n') %}\n {%- set reasoning_content = (message.content.split('</think>')|first).rstrip('\\n') %}\n {%- set reasoning_content = (reasoning_content.split('<think>')|last).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 {{- message.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 enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}"
249
+ }
LLM/vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
README.md ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: other
5
+ tags:
6
+ - whisper
7
+ - qwen3
8
+ - ctranslate2
9
+ - automatic-speech-recognition
10
+ - text-generation
11
+ - air-traffic-control
12
+ - atc
13
+ - singapore
14
+ - military
15
+ pipeline_tag: automatic-speech-recognition
16
+ ---
17
+
18
+ # ASTRA ATC Models
19
+
20
+ Fine-tuned ASR and LLM models for Singapore military air traffic control, built for the [ASTRA](https://github.com/aether-raid) training simulator. The two models work as a pipeline:
21
+
22
+ ```
23
+ Audio --> ASR (Whisper) --> normalized text --> LLM (Qwen3) --> display text
24
+ "camel climb flight level zero nine zero" "CAMEL climb FL090"
25
+ ```
26
+
27
+ ## Models
28
+
29
+ ### [ASR/](./ASR) — Whisper Large v3 (CTranslate2 float16)
30
+
31
+ Fine-tuned for Singapore military ATC speech. Uses CTranslate2 float16 format for fast inference with [faster-whisper](https://github.com/SYSTRAN/faster-whisper).
32
+
33
+ | Metric | Value |
34
+ |--------|-------|
35
+ | WER | **0.24%** |
36
+ | Base model | `jacktol/whisper-large-v3-finetuned-for-ATC` |
37
+ | Size | 2.9 GB |
38
+ | Training data | 6,730 entries (6,680 synthetic + 50 real recordings) |
39
+
40
+ ### [LLM/](./LLM) — Qwen3-1.7B Display Formatter
41
+
42
+ Converts normalized ASR output into structured ATC display text (uppercases callsigns, contracts flight levels, formats frequencies, etc.).
43
+
44
+ | Metric | Value |
45
+ |--------|-------|
46
+ | Exact match | **100%** (161/161) |
47
+ | Base model | `unsloth/Qwen3-1.7B` |
48
+ | Size | 3.3 GB |
49
+ | Training data | 1,915 examples |
50
+
51
+ ## Pipeline Architecture
52
+
53
+ In production, the models are chained with **confidence-based routing**:
54
+
55
+ - **ASR confidence >= 90%** — rule-based formatter (23 deterministic rules, <1ms, 0 VRAM)
56
+ - **ASR confidence < 90%** — LLM formatter (handles noisy/ambiguous ASR output better)
57
+
58
+ ```
59
+ Audio --> VAD (Silero) --> ASR (Whisper ct2) --> Post-processing
60
+ |
61
+ confidence >= 0.90?
62
+ / \
63
+ yes no
64
+ | |
65
+ Rule formatter LLM formatter
66
+ | |
67
+ \ /
68
+ --> Display text
69
+ ```
70
+
71
+ | State | VRAM |
72
+ |-------|------|
73
+ | ASR only (startup) | ~2 GB |
74
+ | ASR + LLM (after first low-confidence call) | ~5.5 GB |
75
+
76
+ ## Domain
77
+
78
+ Singapore military ATC covering:
79
+ - **Airbases**: Tengah (WSAT, runway 18/36), Paya Lebar (WSAP, runway 02/20)
80
+ - **Aircraft**: F-16C/D, F-15SG, C-130
81
+ - **Approaches**: ILS, GCA, PAR, TACAN, DVOR/DME, Visual Straight-in
82
+ - **60 callsigns**: CAMEL, NINJA, BEETLE, TAIPAN, HONDA, etc.
83
+ - **Categories**: departure, approach, handoff, maneuver, landing, emergency, ground, recovery, pilot reports, military-specific ops
84
+
85
+ ## Training History
86
+
87
+ ### ASR
88
+
89
+ | Run | WER | Key Change |
90
+ |-----|-----|------------|
91
+ | ct2_run5 | 0.48% | Initial fine-tune, pitch shift augmentation |
92
+ | ct2_run6 | 0.40% | Removed pitch shift, added BPF/silence padding, weight decay |
93
+ | **ct2_run7** | **0.24%** | Continued training, frozen encoder, +50 real recordings |
94
+
95
+ ### LLM
96
+
97
+ | Run | Accuracy | Key Change |
98
+ |-----|----------|------------|
99
+ | llm_run3 | 98.1% (Qwen3-8B) | QLoRA 4-bit, 871 examples |
100
+ | **llm_run4** | **100%** (Qwen3-1.7B) | bf16 LoRA, 1,915 examples with ASR noise augmentation |
101
+
102
+ ## Quick Start
103
+
104
+ ### ASR
105
+
106
+ ```python
107
+ from faster_whisper import WhisperModel
108
+
109
+ model = WhisperModel("./ASR", device="cuda", compute_type="float16")
110
+ segments, info = model.transcribe("audio.wav", language="en", beam_size=5)
111
+ text = " ".join(seg.text.strip() for seg in segments)
112
+ ```
113
+
114
+ ### LLM
115
+
116
+ ```python
117
+ from transformers import AutoModelForCausalLM, AutoTokenizer
118
+
119
+ model = AutoModelForCausalLM.from_pretrained("./LLM", torch_dtype="auto", device_map="auto")
120
+ tokenizer = AutoTokenizer.from_pretrained("./LLM")
121
+
122
+ messages = [
123
+ {"role": "system", "content": "Convert the following air traffic control transcript into structured display text."},
124
+ {"role": "user", "content": "camel climb flight level zero nine zero"},
125
+ ]
126
+ text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
127
+ inputs = tokenizer(text, return_tensors="pt").to(model.device)
128
+ outputs = model.generate(**inputs, max_new_tokens=128, temperature=0.3, top_p=0.9, top_k=30)
129
+ result = tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True)
130
+ ```
131
+
132
+ ## Download
133
+
134
+ ```bash
135
+ # Full repo
136
+ huggingface-cli download aether-raid/astra-atc-models --local-dir ./models
137
+
138
+ # ASR only
139
+ huggingface-cli download aether-raid/astra-atc-models --include "ASR/*" --local-dir ./models
140
+
141
+ # LLM only
142
+ huggingface-cli download aether-raid/astra-atc-models --include "LLM/*" --local-dir ./models
143
+ ```