Upload tpy07-v1_base model
Browse files- checkpoints/attr_aliases.yaml +72 -0
- checkpoints/best.pt +3 -0
- checkpoints/builtin_aliases.yaml +80 -0
- checkpoints/manifest.json +6 -0
- checkpoints/vocab_98.yaml +141 -0
- config.yaml +73 -0
checkpoints/attr_aliases.yaml
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Fixed 2-letter aliases for common Python attribute names.
|
| 2 |
+
#
|
| 3 |
+
# Any `Attribute.attr` node whose name appears here is emitted as the corresponding 2-letter
|
| 4 |
+
# alias. Attrs not in this table fall back to being emitted as a raw single-letter stream,
|
| 5 |
+
# which often pushes the sample past the 128-token cap and gets it filtered out.
|
| 6 |
+
#
|
| 7 |
+
# Invariants enforced by the Vocab loader:
|
| 8 |
+
# 1. No alias equals a 2-letter Python keyword (`as`, `if`, `in`, `is`, `or`).
|
| 9 |
+
# 2. No alias appears in both this file and `builtin_aliases.yaml`.
|
| 10 |
+
#
|
| 11 |
+
# Aliases are picked as distinctive mnemonics; collisions resolved by picking distinct
|
| 12 |
+
# second letters within a functional group.
|
| 13 |
+
|
| 14 |
+
# --- list / sequence methods ---
|
| 15 |
+
append: aa
|
| 16 |
+
extend: xt
|
| 17 |
+
insert: ti # "in" is a keyword, use ti (ins-erT + I)
|
| 18 |
+
remove: mv
|
| 19 |
+
clear: cw
|
| 20 |
+
count: ct
|
| 21 |
+
|
| 22 |
+
# --- dict / set methods ---
|
| 23 |
+
update: ud
|
| 24 |
+
setdefault: sf
|
| 25 |
+
pop: pp
|
| 26 |
+
popitem: pi
|
| 27 |
+
items: jm # "it" would collide with iter's alias; use j as mnemonic for pl-j-urals
|
| 28 |
+
keys: kk
|
| 29 |
+
get: gu
|
| 30 |
+
values: vu
|
| 31 |
+
|
| 32 |
+
# --- sorting / reversing (distinct from builtins sorted/reversed) ---
|
| 33 |
+
sort: so
|
| 34 |
+
reverse: vv # "rv" is taken by reversed()
|
| 35 |
+
|
| 36 |
+
# --- string methods ---
|
| 37 |
+
find: fi
|
| 38 |
+
split: pl
|
| 39 |
+
join: jn
|
| 40 |
+
strip: tq
|
| 41 |
+
lower: lw
|
| 42 |
+
upper: ur
|
| 43 |
+
replace: rl
|
| 44 |
+
startswith: sw
|
| 45 |
+
endswith: ew
|
| 46 |
+
encode: nc
|
| 47 |
+
decode: dk # "de" feels too generic
|
| 48 |
+
format: ft
|
| 49 |
+
|
| 50 |
+
# --- file / io methods ---
|
| 51 |
+
read: rd
|
| 52 |
+
write: wt
|
| 53 |
+
readline: rq
|
| 54 |
+
readlines: rw
|
| 55 |
+
close: cg
|
| 56 |
+
seek: sq
|
| 57 |
+
tell: tu
|
| 58 |
+
flush: fu
|
| 59 |
+
|
| 60 |
+
# --- object attributes ---
|
| 61 |
+
name: nm
|
| 62 |
+
value: vl
|
| 63 |
+
data: da
|
| 64 |
+
size: sz
|
| 65 |
+
length: lh
|
| 66 |
+
shape: sk
|
| 67 |
+
dtype: dy
|
| 68 |
+
|
| 69 |
+
# --- common numeric attrs (ndarray / tensor) ---
|
| 70 |
+
mean: mj
|
| 71 |
+
std: sj
|
| 72 |
+
var: va
|
checkpoints/best.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e0a7e592596866548a61b317bdeebff52fd11d003ba96d02c02ea7f9e610beab
|
| 3 |
+
size 734545
|
checkpoints/builtin_aliases.yaml
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Fixed 2-letter aliases for common Python built-in names.
|
| 2 |
+
#
|
| 3 |
+
# Each alias costs 2 alphabet tokens per use but preserves the full 26-slot user-identifier
|
| 4 |
+
# table. The Vocab loader enforces two invariants:
|
| 5 |
+
#
|
| 6 |
+
# 1. No alias equals a 2-letter Python keyword (`as`, `if`, `in`, `is`, `or`) — those
|
| 7 |
+
# would be retokenized as keywords during decoding.
|
| 8 |
+
# 2. No alias appears in both this file and `attr_aliases.yaml` — the two tables share a
|
| 9 |
+
# single inverse-lookup namespace at decode time.
|
| 10 |
+
#
|
| 11 |
+
# Grow this list when your dataset uses built-ins not yet covered. Aliases are chosen as a
|
| 12 |
+
# distinctive 2-letter mnemonic of the name.
|
| 13 |
+
|
| 14 |
+
# --- common functions ---
|
| 15 |
+
print: pr
|
| 16 |
+
len: le
|
| 17 |
+
range: ra
|
| 18 |
+
int: nt
|
| 19 |
+
str: st
|
| 20 |
+
list: ls
|
| 21 |
+
dict: dc
|
| 22 |
+
set: et
|
| 23 |
+
tuple: tp
|
| 24 |
+
type: ty
|
| 25 |
+
map: mp
|
| 26 |
+
filter: fl
|
| 27 |
+
zip: zp
|
| 28 |
+
enumerate: em
|
| 29 |
+
sorted: sr
|
| 30 |
+
reversed: rv
|
| 31 |
+
sum: sm
|
| 32 |
+
min: mn
|
| 33 |
+
max: mx
|
| 34 |
+
abs: ab
|
| 35 |
+
any: ay
|
| 36 |
+
all: aw
|
| 37 |
+
open: op
|
| 38 |
+
repr: rp
|
| 39 |
+
hash: hh
|
| 40 |
+
bool: bl
|
| 41 |
+
float: fo
|
| 42 |
+
bytes: by
|
| 43 |
+
input: pu
|
| 44 |
+
round: rn
|
| 45 |
+
divmod: dm
|
| 46 |
+
pow: pw
|
| 47 |
+
iter: tr
|
| 48 |
+
next: nx
|
| 49 |
+
object: ob
|
| 50 |
+
hex: hx
|
| 51 |
+
oct: oc
|
| 52 |
+
bin: bn
|
| 53 |
+
chr: cr
|
| 54 |
+
ord: od
|
| 55 |
+
format: ff
|
| 56 |
+
callable: cb
|
| 57 |
+
|
| 58 |
+
# --- common methods masquerading as built-ins ---
|
| 59 |
+
isinstance: ii
|
| 60 |
+
hasattr: hs
|
| 61 |
+
getattr: ga
|
| 62 |
+
setattr: sa
|
| 63 |
+
super: su
|
| 64 |
+
property: pt
|
| 65 |
+
staticmethod: sc
|
| 66 |
+
classmethod: cm
|
| 67 |
+
|
| 68 |
+
# --- exceptions ---
|
| 69 |
+
ValueError: ve
|
| 70 |
+
TypeError: te
|
| 71 |
+
IndexError: ix
|
| 72 |
+
KeyError: ke
|
| 73 |
+
StopIteration: si
|
| 74 |
+
Exception: xe
|
| 75 |
+
NotImplementedError: ni
|
| 76 |
+
RuntimeError: re
|
| 77 |
+
AttributeError: ae
|
| 78 |
+
ZeroDivisionError: zd
|
| 79 |
+
FileNotFoundError: fx
|
| 80 |
+
OSError: oo
|
checkpoints/manifest.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"fingerprint": "e2a95ef79baa37962dfec3897f03b8b54774e8c6e923b8c7badd1d77ca326ff1",
|
| 3 |
+
"epoch": 20,
|
| 4 |
+
"val_loss": 0.1479419188634042,
|
| 5 |
+
"encoder_name": "jhu-clsp/ettin-encoder-17m"
|
| 6 |
+
}
|
checkpoints/vocab_98.yaml
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Default 98-token vocabulary.
|
| 2 |
+
#
|
| 3 |
+
# Token IDs are assigned by concatenating the ordered category lists in the order they appear
|
| 4 |
+
# below. IDs are therefore content-addressable and stable across reloads. The Vocab loader
|
| 5 |
+
# computes a sha256 "fingerprint" over the canonical YAML, which is embedded in every checkpoint
|
| 6 |
+
# to detect silent mismatches at inference time.
|
| 7 |
+
#
|
| 8 |
+
# Categories (ordered):
|
| 9 |
+
# specials (3) BOS, EOS, PAD
|
| 10 |
+
# structural (4) NEWLINE, INDENT, DEDENT, STR_QUOTE
|
| 11 |
+
# keywords (35) Python reserved words
|
| 12 |
+
# alphabet (26) single-letter identifiers a..z
|
| 13 |
+
# digits (10) 0..9
|
| 14 |
+
# operators (23) punctuation and multi-char ops (<=, >=, ==, !=, **)
|
| 15 |
+
#
|
| 16 |
+
# Total: 3 + 4 + 35 + 26 + 10 + 23 = 101.
|
| 17 |
+
#
|
| 18 |
+
# NOTE: The design doc states 98 tokens. The specials are counted separately in the spec
|
| 19 |
+
# (BOS/EOS/PAD = 3 specials, not part of the "98"). When we say "98-token vocabulary" we mean
|
| 20 |
+
# the 98 content-bearing tokens (35 keywords + 26 alphabet + 10 digits + 23 operators +
|
| 21 |
+
# 4 structural). Total model vocabulary size including specials is 101; this is what
|
| 22 |
+
# `Vocab.size` reports, since specials have real IDs that the decoder emits.
|
| 23 |
+
|
| 24 |
+
version: 1
|
| 25 |
+
|
| 26 |
+
categories:
|
| 27 |
+
specials:
|
| 28 |
+
- PAD
|
| 29 |
+
- BOS
|
| 30 |
+
- EOS
|
| 31 |
+
structural:
|
| 32 |
+
- NEWLINE
|
| 33 |
+
- INDENT
|
| 34 |
+
- DEDENT
|
| 35 |
+
- STR_QUOTE
|
| 36 |
+
keywords:
|
| 37 |
+
- "False"
|
| 38 |
+
- "None"
|
| 39 |
+
- "True"
|
| 40 |
+
- and
|
| 41 |
+
- as
|
| 42 |
+
- assert
|
| 43 |
+
- async
|
| 44 |
+
- await
|
| 45 |
+
- break
|
| 46 |
+
- class
|
| 47 |
+
- continue
|
| 48 |
+
- def
|
| 49 |
+
- del
|
| 50 |
+
- elif
|
| 51 |
+
- else
|
| 52 |
+
- except
|
| 53 |
+
- finally
|
| 54 |
+
- for
|
| 55 |
+
- from
|
| 56 |
+
- global
|
| 57 |
+
- if
|
| 58 |
+
- import
|
| 59 |
+
- in
|
| 60 |
+
- is
|
| 61 |
+
- lambda
|
| 62 |
+
- nonlocal
|
| 63 |
+
- not
|
| 64 |
+
- or
|
| 65 |
+
- pass
|
| 66 |
+
- raise
|
| 67 |
+
- return
|
| 68 |
+
- try
|
| 69 |
+
- while
|
| 70 |
+
- with
|
| 71 |
+
- yield
|
| 72 |
+
alphabet:
|
| 73 |
+
- a
|
| 74 |
+
- b
|
| 75 |
+
- c
|
| 76 |
+
- d
|
| 77 |
+
- e
|
| 78 |
+
- f
|
| 79 |
+
- g
|
| 80 |
+
- h
|
| 81 |
+
- i
|
| 82 |
+
- j
|
| 83 |
+
- k
|
| 84 |
+
- l
|
| 85 |
+
- m
|
| 86 |
+
- n
|
| 87 |
+
- o
|
| 88 |
+
- p
|
| 89 |
+
- q
|
| 90 |
+
- r
|
| 91 |
+
- s
|
| 92 |
+
- t
|
| 93 |
+
- u
|
| 94 |
+
- v
|
| 95 |
+
- w
|
| 96 |
+
- x
|
| 97 |
+
- y
|
| 98 |
+
- z
|
| 99 |
+
digits:
|
| 100 |
+
- "0"
|
| 101 |
+
- "1"
|
| 102 |
+
- "2"
|
| 103 |
+
- "3"
|
| 104 |
+
- "4"
|
| 105 |
+
- "5"
|
| 106 |
+
- "6"
|
| 107 |
+
- "7"
|
| 108 |
+
- "8"
|
| 109 |
+
- "9"
|
| 110 |
+
operators:
|
| 111 |
+
- "("
|
| 112 |
+
- ")"
|
| 113 |
+
- "["
|
| 114 |
+
- "]"
|
| 115 |
+
- "{"
|
| 116 |
+
- "}"
|
| 117 |
+
- ":"
|
| 118 |
+
- ","
|
| 119 |
+
- "."
|
| 120 |
+
- "="
|
| 121 |
+
- "+"
|
| 122 |
+
- "-"
|
| 123 |
+
- "*"
|
| 124 |
+
- "/"
|
| 125 |
+
- "%"
|
| 126 |
+
- "<"
|
| 127 |
+
- ">"
|
| 128 |
+
- "!"
|
| 129 |
+
- "=="
|
| 130 |
+
- "!="
|
| 131 |
+
- "<="
|
| 132 |
+
- ">="
|
| 133 |
+
- "**"
|
| 134 |
+
|
| 135 |
+
max_user_identifiers: 26
|
| 136 |
+
max_string_length: 20
|
| 137 |
+
|
| 138 |
+
string_charmap:
|
| 139 |
+
space: s
|
| 140 |
+
underscore: u
|
| 141 |
+
fallback: "?"
|
config.yaml
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
encoder:
|
| 2 |
+
name: jhu-clsp/ettin-encoder-17m
|
| 3 |
+
max_length: 512
|
| 4 |
+
dtype: bfloat16
|
| 5 |
+
trust_remote_code: false
|
| 6 |
+
decoder:
|
| 7 |
+
d_model: 64
|
| 8 |
+
n_layer: 2
|
| 9 |
+
n_head: 4
|
| 10 |
+
d_ff: 256
|
| 11 |
+
max_seq_len: 128
|
| 12 |
+
prefix_len: 4
|
| 13 |
+
dropout: 0.0
|
| 14 |
+
tie_embeddings: true
|
| 15 |
+
cross_attention: false
|
| 16 |
+
enc_memory_len: 128
|
| 17 |
+
pos_encoding: learned
|
| 18 |
+
mlp_type: gelu
|
| 19 |
+
copy_head: false
|
| 20 |
+
data:
|
| 21 |
+
hf_name: parquet
|
| 22 |
+
data_files: /tmp/tpy_build/07_deduped.parquet
|
| 23 |
+
split: train
|
| 24 |
+
val_fraction: 0.02
|
| 25 |
+
max_identifiers: 26
|
| 26 |
+
max_tokens: 128
|
| 27 |
+
instruction_field: instruction
|
| 28 |
+
code_field: response
|
| 29 |
+
stdlib_whitelist_path: null
|
| 30 |
+
num_proc: 8
|
| 31 |
+
cache_dir: .cache/tiny_decoder/tpy07_v1
|
| 32 |
+
drop_stub_bodies: false
|
| 33 |
+
pack: false
|
| 34 |
+
pack_len: 512
|
| 35 |
+
vocab:
|
| 36 |
+
path: configs/vocab_98.yaml
|
| 37 |
+
builtin_aliases_path: configs/builtin_aliases.yaml
|
| 38 |
+
attr_aliases_path: configs/attr_aliases.yaml
|
| 39 |
+
train:
|
| 40 |
+
batch_size: 128
|
| 41 |
+
epochs: 50
|
| 42 |
+
lr: 0.0003
|
| 43 |
+
warmup_frac: 0.05
|
| 44 |
+
weight_decay: 0.1
|
| 45 |
+
grad_clip: 1.0
|
| 46 |
+
early_stop_patience: 5
|
| 47 |
+
seed: 0
|
| 48 |
+
log_every: 50
|
| 49 |
+
eval_every_epochs: 1
|
| 50 |
+
wandb_project: null
|
| 51 |
+
tensorboard_dir: null
|
| 52 |
+
weighted_sampling: false
|
| 53 |
+
init_from: null
|
| 54 |
+
pretrain_sampling: short
|
| 55 |
+
amp_dtype: bf16
|
| 56 |
+
compile: false
|
| 57 |
+
bench_every_epochs: 0
|
| 58 |
+
bench_benchmark: both
|
| 59 |
+
bench_max_problems: null
|
| 60 |
+
bench_num_samples: 5
|
| 61 |
+
bench_temperature: 0.8
|
| 62 |
+
bench_pass_k: 1,5
|
| 63 |
+
bench_timeout: 3.0
|
| 64 |
+
bench_num_workers: 16
|
| 65 |
+
bench_max_new_tokens: null
|
| 66 |
+
eval:
|
| 67 |
+
split: val
|
| 68 |
+
max_samples: null
|
| 69 |
+
compute_exact_match: true
|
| 70 |
+
compute_syntactic_validity: true
|
| 71 |
+
run:
|
| 72 |
+
dir: runs/tpy07/v1_base
|
| 73 |
+
save_every_epochs: 1
|