worthant commited on
Commit
becafda
·
verified ·
1 Parent(s): 5f80ead

Upload tools/vocab_sweep.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. tools/vocab_sweep.py +5 -2
tools/vocab_sweep.py CHANGED
@@ -68,6 +68,9 @@ def decode_piece(piece: str, byte_decoder: dict[str, int]) -> str | None:
68
  def main() -> int:
69
  ap = argparse.ArgumentParser()
70
  ap.add_argument("--tokenizer", required=True)
 
 
 
71
  ap.add_argument("--include-special", action="store_true", default=True,
72
  help="also sweep the 2,048 added/special ids")
73
  ap.add_argument("--no-include-special", dest="include_special", action="store_false")
@@ -155,9 +158,9 @@ def main() -> int:
155
  "function of the tokenizer, not of the corpus"},
156
  ))
157
  out = os.path.join(P.POOL_ROOT, "vocab_sweep", "synthetic",
158
- "muse-glimmer-30b.jsonl")
159
  n = P.write_jsonl(out, records)
160
- print(f" pool/vocab_sweep/synthetic/muse-glimmer-30b.jsonl {n} documents")
161
 
162
  stats = {
163
  "tokenizer": os.path.abspath(args.tokenizer),
 
68
  def main() -> int:
69
  ap = argparse.ArgumentParser()
70
  ap.add_argument("--tokenizer", required=True)
71
+ ap.add_argument("--name", default="muse-glimmer-30b",
72
+ help="basename of the sweep shard under "
73
+ "pool/vocab_sweep/synthetic/ (one per target model)")
74
  ap.add_argument("--include-special", action="store_true", default=True,
75
  help="also sweep the 2,048 added/special ids")
76
  ap.add_argument("--no-include-special", dest="include_special", action="store_false")
 
158
  "function of the tokenizer, not of the corpus"},
159
  ))
160
  out = os.path.join(P.POOL_ROOT, "vocab_sweep", "synthetic",
161
+ f"{args.name}.jsonl")
162
  n = P.write_jsonl(out, records)
163
+ print(f" pool/vocab_sweep/synthetic/{args.name}.jsonl {n} documents")
164
 
165
  stats = {
166
  "tokenizer": os.path.abspath(args.tokenizer),