voidful commited on
Commit
82e506e
·
verified ·
1 Parent(s): aaed96a

Upload Pangolin tokenizer

Browse files
README.md ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ library_name: transformers
4
+ tags:
5
+ - tokenizer
6
+ - byte-level-bpe
7
+ - traditional-chinese
8
+ - taiwan
9
+ - multilingual
10
+ ---
11
+
12
+ # PangolinTokenizer
13
+
14
+ Byte-level BPE tokenizer trained for Traditional Chinese, Taiwan text, multilingual
15
+ text, rich transcription, OCR-style text, and generic multimodal control formats.
16
+
17
+ ## Usage
18
+
19
+ ```python
20
+ from transformers import AutoTokenizer
21
+
22
+ tokenizer = AutoTokenizer.from_pretrained(
23
+ "voidful/PangolinTokenizer",
24
+ trust_remote_code=False,
25
+ )
26
+
27
+ text = "<|system|>台灣健保與注音ㄅㄆㄇ,Tailo: Tâi-uân"
28
+ ids = tokenizer.encode(text)
29
+ decoded = tokenizer.decode(ids)
30
+ ```
31
+
32
+ ## Files
33
+
34
+ - `config.json`
35
+ - `tokenizer_config.json`
36
+ - `tokenizer.json`
37
+ - `vocab.json`
38
+ - `merges.txt`
39
+ - `special_tokens_map.json`
40
+ - `evaluation_report.json`
41
+
42
+ ## Tokenizer Details
43
+
44
+ - Type: Byte-level BPE
45
+ - Vocabulary size: 114,688
46
+ - Learned merges: 114,397
47
+ - Model max length metadata: 131,072
48
+ - Minimum merge frequency: 5
49
+ - Transformers class: `GPT2TokenizerFast`
50
+ - `trust_remote_code`: not required
51
+
52
+ ## Safety Notes
53
+
54
+ This tokenizer intentionally does not include discrete audio codec token ranges.
55
+ It also intentionally does not include dense timestamp token ranges. Audio should
56
+ be represented through external references or embeddings outside this tokenizer.
57
+
58
+ Evaluation checks confirmed:
59
+
60
+ - Transformers `AutoTokenizer` loading works with `trust_remote_code=False`
61
+ - Traditional Chinese and Bopomofo smoke roundtrip works
62
+ - No tokens matching `<|audio_[0-9]+|>`
63
+ - No dense timestamp token ranges matching `<|ts_[0-9]+|>`,
64
+ `<|timestamp_[0-9]+|>`, or `<|time_[0-9]+|>`
config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "gpt2",
3
+ "tokenizer_class": "GPT2TokenizerFast",
4
+ "vocab_size": 114688,
5
+ "model_max_length": 131072
6
+ }
evaluation_report.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "ok": true,
3
+ "failures": [],
4
+ "sections": {
5
+ "Timestamp / rich transcription checks": {
6
+ "rich_transcription_token_ids": {
7
+ "<|transcript_start|>": 114670,
8
+ "<|transcript_end|>": 114671,
9
+ "<|segment_start|>": 114672,
10
+ "<|segment_end|>": 114673,
11
+ "<|speaker|>": 114674,
12
+ "<|start_time|>": 114675,
13
+ "<|end_time|>": 114676,
14
+ "<|duration|>": 114677,
15
+ "<|content|>": 114678,
16
+ "<|non_speech_event|>": 114679
17
+ },
18
+ "timestamp_precision_digits": 2,
19
+ "json_roundtrip_ok": true,
20
+ "dense_timestamp_tokens_found": [],
21
+ "missing_rich_transcription_tokens": [],
22
+ "timestamp_strings_present": {
23
+ "0.00": true,
24
+ "3.42": true,
25
+ "10.25": true,
26
+ "3575.50": true
27
+ },
28
+ "non_speech_labels_present": {
29
+ "[Silence]": true,
30
+ "[Noise]": true,
31
+ "[Music]": true,
32
+ "[Unintelligible Speech]": true
33
+ },
34
+ "text_roundtrip_ok": {
35
+ "traditional_chinese": true,
36
+ "bopomofo_mixed_romanization": true,
37
+ "json_syntax": true
38
+ },
39
+ "required_fields_ok": true,
40
+ "parse_error": null
41
+ }
42
+ },
43
+ "rich_transcription_token_ids": {
44
+ "<|transcript_start|>": 114670,
45
+ "<|transcript_end|>": 114671,
46
+ "<|segment_start|>": 114672,
47
+ "<|segment_end|>": 114673,
48
+ "<|speaker|>": 114674,
49
+ "<|start_time|>": 114675,
50
+ "<|end_time|>": 114676,
51
+ "<|duration|>": 114677,
52
+ "<|content|>": 114678,
53
+ "<|non_speech_event|>": 114679
54
+ },
55
+ "timestamp_precision_digits": 2,
56
+ "json_roundtrip_ok": true,
57
+ "dense_timestamp_tokens_found": []
58
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
special_tokens_map.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|system|>",
4
+ "<|user_channel|>",
5
+ "<|assistant_channel|>",
6
+ "<|task:speech_to_text|>",
7
+ "<|task:text_to_speech|>",
8
+ "<|input_audio_start|>",
9
+ "<|input_audio_end|>",
10
+ "<|audio_ref_start|>",
11
+ "<|audio_ref_end|>",
12
+ "<|audio_start|>",
13
+ "<|audio_end|>",
14
+ "<|speech_start|>",
15
+ "<|speech_end|>",
16
+ "<|transcript_start|>",
17
+ "<|transcript_end|>",
18
+ "<|segment_start|>",
19
+ "<|segment_end|>",
20
+ "<|speaker|>",
21
+ "<|start_time|>",
22
+ "<|end_time|>",
23
+ "<|duration|>",
24
+ "<|content|>",
25
+ "<|non_speech_event|>",
26
+ "<|retrieval_result_start|>",
27
+ "<|retrieval_result_end|>",
28
+ "<|ocr_start|>",
29
+ "<|ocr_end|>",
30
+ "<|image_start|>",
31
+ "<|image_end|>",
32
+ "<|video_start|>",
33
+ "<|video_end|>"
34
+ ],
35
+ "pad_token": "<|pad|>",
36
+ "bos_token": "<|bos|>",
37
+ "eos_token": "<|eos|>",
38
+ "unk_token": "<|unk|>"
39
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|bos|>",
4
+ "eos_token": "<|eos|>",
5
+ "extra_special_tokens": [
6
+ "<|system|>",
7
+ "<|user_channel|>",
8
+ "<|assistant_channel|>",
9
+ "<|task:speech_to_text|>",
10
+ "<|task:text_to_speech|>",
11
+ "<|input_audio_start|>",
12
+ "<|input_audio_end|>",
13
+ "<|audio_ref_start|>",
14
+ "<|audio_ref_end|>",
15
+ "<|audio_start|>",
16
+ "<|audio_end|>",
17
+ "<|speech_start|>",
18
+ "<|speech_end|>",
19
+ "<|transcript_start|>",
20
+ "<|transcript_end|>",
21
+ "<|segment_start|>",
22
+ "<|segment_end|>",
23
+ "<|speaker|>",
24
+ "<|start_time|>",
25
+ "<|end_time|>",
26
+ "<|duration|>",
27
+ "<|content|>",
28
+ "<|non_speech_event|>",
29
+ "<|retrieval_result_start|>",
30
+ "<|retrieval_result_end|>",
31
+ "<|ocr_start|>",
32
+ "<|ocr_end|>",
33
+ "<|image_start|>",
34
+ "<|image_end|>",
35
+ "<|video_start|>",
36
+ "<|video_end|>"
37
+ ],
38
+ "model_max_length": 131072,
39
+ "model_type": "byte_level_bpe",
40
+ "pad_token": "<|pad|>",
41
+ "rich_transcription": {
42
+ "allow_non_speech_events": true,
43
+ "compact_json": true,
44
+ "default_format": "json_segments",
45
+ "enabled": true,
46
+ "include_content": true,
47
+ "include_speaker": true,
48
+ "include_start_end": true,
49
+ "no_dense_timestamp_tokens": true,
50
+ "timestamp_precision_digits": 2,
51
+ "timestamp_unit": "seconds"
52
+ },
53
+ "special_tokens": [
54
+ "<|pad|>",
55
+ "<|bos|>",
56
+ "<|eos|>",
57
+ "<|unk|>",
58
+ "<|system|>",
59
+ "<|user_channel|>",
60
+ "<|assistant_channel|>",
61
+ "<|task:speech_to_text|>",
62
+ "<|task:text_to_speech|>",
63
+ "<|input_audio_start|>",
64
+ "<|input_audio_end|>",
65
+ "<|audio_ref_start|>",
66
+ "<|audio_ref_end|>",
67
+ "<|audio_start|>",
68
+ "<|audio_end|>",
69
+ "<|speech_start|>",
70
+ "<|speech_end|>",
71
+ "<|transcript_start|>",
72
+ "<|transcript_end|>",
73
+ "<|segment_start|>",
74
+ "<|segment_end|>",
75
+ "<|speaker|>",
76
+ "<|start_time|>",
77
+ "<|end_time|>",
78
+ "<|duration|>",
79
+ "<|content|>",
80
+ "<|non_speech_event|>",
81
+ "<|retrieval_result_start|>",
82
+ "<|retrieval_result_end|>",
83
+ "<|ocr_start|>",
84
+ "<|ocr_end|>",
85
+ "<|image_start|>",
86
+ "<|image_end|>",
87
+ "<|video_start|>",
88
+ "<|video_end|>"
89
+ ],
90
+ "strict_no_dense_timestamp_tokens": true,
91
+ "tokenizer_class": "GPT2TokenizerFast",
92
+ "unk_token": "<|unk|>",
93
+ "vocab_size": 114688,
94
+ "padding_side": "right",
95
+ "truncation_side": "right",
96
+ "clean_up_tokenization_spaces": false,
97
+ "no_audio_codec_tokens": true,
98
+ "no_dense_timestamp_tokens": true,
99
+ "fix_mistral_regex": true
100
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff