Commit ·
14fb526
1
Parent(s): ccfa260
Add canonical kacperwikiel tokenizer
Browse files- README.md +4 -3
- build_parquet.py +38 -0
- data/train-00000-of-00001.parquet +2 -2
README.md
CHANGED
|
@@ -14,9 +14,9 @@ Normalized tokenizer artifacts collected from the contributor directories in
|
|
| 14 |
[`slayerlabs/tokenizer`](https://github.com/slayerlabs/tokenizer/tree/1a5cd2c2e4df2287b4c19b3dbf5051f5d460fdc1),
|
| 15 |
pinned to source commit `1a5cd2c2e4df2287b4c19b3dbf5051f5d460fdc1`.
|
| 16 |
|
| 17 |
-
The dataset contains one row per tokenizer: 38
|
| 18 |
-
|
| 19 |
-
filter, and compare
|
| 20 |
|
| 21 |
## Columns
|
| 22 |
|
|
@@ -33,6 +33,7 @@ filter, and compare the tokenizers without navigating contributor folders.
|
|
| 33 |
- `reported_metrics`: evaluation numbers reported by the author, encoded as JSON.
|
| 34 |
- `metadata`: normalized metadata encoded as a JSON string.
|
| 35 |
- `tokenizer_json`: complete, lossless original JSON file contents.
|
|
|
|
| 36 |
- `source_path`: original path in the source repository.
|
| 37 |
- `source_commit`: pinned source Git commit.
|
| 38 |
- `bytes`: original JSON file size.
|
|
|
|
| 14 |
[`slayerlabs/tokenizer`](https://github.com/slayerlabs/tokenizer/tree/1a5cd2c2e4df2287b4c19b3dbf5051f5d460fdc1),
|
| 15 |
pinned to source commit `1a5cd2c2e4df2287b4c19b3dbf5051f5d460fdc1`.
|
| 16 |
|
| 17 |
+
The dataset contains one row per tokenizer: the 38 workshop submissions plus
|
| 18 |
+
the canonical SlayerLab Polish 32k tokenizer by `kacperwikiel`. Use the Dataset
|
| 19 |
+
Viewer to sort, filter, and compare tokenizers without navigating folders.
|
| 20 |
|
| 21 |
## Columns
|
| 22 |
|
|
|
|
| 33 |
- `reported_metrics`: evaluation numbers reported by the author, encoded as JSON.
|
| 34 |
- `metadata`: normalized metadata encoded as a JSON string.
|
| 35 |
- `tokenizer_json`: complete, lossless original JSON file contents.
|
| 36 |
+
- `source_repo`: repository containing the original artifact.
|
| 37 |
- `source_path`: original path in the source repository.
|
| 38 |
- `source_commit`: pinned source Git commit.
|
| 39 |
- `bytes`: original JSON file size.
|
build_parquet.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
| 3 |
|
| 4 |
import argparse
|
| 5 |
import csv
|
|
|
|
| 6 |
import json
|
| 7 |
from pathlib import Path
|
| 8 |
|
|
@@ -11,6 +12,7 @@ import pyarrow.parquet as pq
|
|
| 11 |
|
| 12 |
|
| 13 |
SOURCE_COMMIT = "1a5cd2c2e4df2287b4c19b3dbf5051f5d460fdc1"
|
|
|
|
| 14 |
GITHUB_AUTHORS = {
|
| 15 |
"Arek": "Maggio333",
|
| 16 |
"KasiaMP": "KateMajzel",
|
|
@@ -87,6 +89,7 @@ def main() -> None:
|
|
| 87 |
parser.add_argument("--source-root", type=Path, default=Path("."))
|
| 88 |
parser.add_argument("--manifest", type=Path, default=Path("manifest.csv"))
|
| 89 |
parser.add_argument("--output", type=Path, default=Path("data/train-00000-of-00001.parquet"))
|
|
|
|
| 90 |
args = parser.parse_args()
|
| 91 |
|
| 92 |
rows = []
|
|
@@ -118,6 +121,7 @@ def main() -> None:
|
|
| 118 |
extract_metadata(document), ensure_ascii=False, sort_keys=True
|
| 119 |
),
|
| 120 |
"tokenizer_json": raw_json,
|
|
|
|
| 121 |
"source_path": source_path,
|
| 122 |
"source_commit": SOURCE_COMMIT,
|
| 123 |
"bytes": int(item["bytes"]),
|
|
@@ -125,6 +129,39 @@ def main() -> None:
|
|
| 125 |
}
|
| 126 |
)
|
| 127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
schema = pa.schema(
|
| 129 |
[
|
| 130 |
("author", pa.string()),
|
|
@@ -143,6 +180,7 @@ def main() -> None:
|
|
| 143 |
("reported_metrics", pa.string()),
|
| 144 |
("metadata", pa.string()),
|
| 145 |
("tokenizer_json", pa.large_string()),
|
|
|
|
| 146 |
("source_path", pa.string()),
|
| 147 |
("source_commit", pa.string()),
|
| 148 |
("bytes", pa.int64()),
|
|
|
|
| 3 |
|
| 4 |
import argparse
|
| 5 |
import csv
|
| 6 |
+
import hashlib
|
| 7 |
import json
|
| 8 |
from pathlib import Path
|
| 9 |
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
SOURCE_COMMIT = "1a5cd2c2e4df2287b4c19b3dbf5051f5d460fdc1"
|
| 15 |
+
KACPER_SOURCE_COMMIT = "8a273e6fd6e05b56d9d05e15e0de8232f8be3548"
|
| 16 |
GITHUB_AUTHORS = {
|
| 17 |
"Arek": "Maggio333",
|
| 18 |
"KasiaMP": "KateMajzel",
|
|
|
|
| 89 |
parser.add_argument("--source-root", type=Path, default=Path("."))
|
| 90 |
parser.add_argument("--manifest", type=Path, default=Path("manifest.csv"))
|
| 91 |
parser.add_argument("--output", type=Path, default=Path("data/train-00000-of-00001.parquet"))
|
| 92 |
+
parser.add_argument("--kacper-tokenizer", type=Path)
|
| 93 |
args = parser.parse_args()
|
| 94 |
|
| 95 |
rows = []
|
|
|
|
| 121 |
extract_metadata(document), ensure_ascii=False, sort_keys=True
|
| 122 |
),
|
| 123 |
"tokenizer_json": raw_json,
|
| 124 |
+
"source_repo": "https://github.com/slayerlabs/tokenizer",
|
| 125 |
"source_path": source_path,
|
| 126 |
"source_commit": SOURCE_COMMIT,
|
| 127 |
"bytes": int(item["bytes"]),
|
|
|
|
| 129 |
}
|
| 130 |
)
|
| 131 |
|
| 132 |
+
if args.kacper_tokenizer:
|
| 133 |
+
raw_json = args.kacper_tokenizer.read_text(encoding="utf-8")
|
| 134 |
+
document = json.loads(raw_json)
|
| 135 |
+
model = document["model"]
|
| 136 |
+
metrics = extract_reported_metrics(document)
|
| 137 |
+
rows.append(
|
| 138 |
+
{
|
| 139 |
+
"author": "kacperwikiel",
|
| 140 |
+
"size": len(model["vocab"]),
|
| 141 |
+
"name": "polish_bpe_32k.json",
|
| 142 |
+
"quick_status": "ready_hf_tokenizers",
|
| 143 |
+
"hf_loadable": True,
|
| 144 |
+
"format": "hf_tokenizers",
|
| 145 |
+
"model_type": model["type"],
|
| 146 |
+
"merge_count": merge_count(document),
|
| 147 |
+
"normalizer": component_name(document.get("normalizer")),
|
| 148 |
+
"pre_tokenizer": component_name(document.get("pre_tokenizer")),
|
| 149 |
+
"decoder": component_name(document.get("decoder")),
|
| 150 |
+
"unk_token": str(model.get("unk_token") or ""),
|
| 151 |
+
"added_tokens_count": len(document.get("added_tokens", [])),
|
| 152 |
+
"reported_metrics": json.dumps(metrics, ensure_ascii=False, sort_keys=True),
|
| 153 |
+
"metadata": json.dumps(
|
| 154 |
+
extract_metadata(document), ensure_ascii=False, sort_keys=True
|
| 155 |
+
),
|
| 156 |
+
"tokenizer_json": raw_json,
|
| 157 |
+
"source_repo": "https://huggingface.co/SlayerLab/slayer-scratch",
|
| 158 |
+
"source_path": "tokenizers/polish_bpe_32k.json",
|
| 159 |
+
"source_commit": KACPER_SOURCE_COMMIT,
|
| 160 |
+
"bytes": len(raw_json.encode("utf-8")),
|
| 161 |
+
"sha256": hashlib.sha256(raw_json.encode("utf-8")).hexdigest(),
|
| 162 |
+
}
|
| 163 |
+
)
|
| 164 |
+
|
| 165 |
schema = pa.schema(
|
| 166 |
[
|
| 167 |
("author", pa.string()),
|
|
|
|
| 180 |
("reported_metrics", pa.string()),
|
| 181 |
("metadata", pa.string()),
|
| 182 |
("tokenizer_json", pa.large_string()),
|
| 183 |
+
("source_repo", pa.string()),
|
| 184 |
("source_path", pa.string()),
|
| 185 |
("source_commit", pa.string()),
|
| 186 |
("bytes", pa.int64()),
|
data/train-00000-of-00001.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a631ad16d7ce5000d41a9d0cd05e6a3398c02b81c87d5e1dff0b2534e47b592b
|
| 3 |
+
size 16896171
|