summaryrefslogtreecommitdiff
path: root/research/lesci
diff options
context:
space:
mode:
authorJonas Knobloch <jonas.knobloch@t-online.de>2026-04-24 11:49:26 +0200
committerJonas Knobloch <jonas.knobloch@t-online.de>2026-04-24 11:50:02 +0200
commit12f15fdd8c048e5958e294f12a9f163f6f950b3e (patch)
tree16bb23c134f1fe476d977dd846e6dda6c7667c48 /research/lesci
parent408536516bdfedc93d93226dc08280ed224361fc (diff)
Recover tokenization based on config
Diffstat (limited to 'research/lesci')
-rw-r--r--research/lesci/cmd/lesci/main.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/research/lesci/cmd/lesci/main.go b/research/lesci/cmd/lesci/main.go
index c52013a..27c257a 100644
--- a/research/lesci/cmd/lesci/main.go
+++ b/research/lesci/cmd/lesci/main.go
@@ -45,8 +45,14 @@ func setup(control, treatment int) (*lesci.Experiment, *gpt2.Model) {
b := fmt.Sprintf(shelf.Abs("models/mbpe/gpt2_%d_m000_babylm_v2"), 100512)
m := must(model(path.Join(a, "model_eval.onnx"), control))
- t := must(bpe.NewTokenizerFromFiles(path.Join(a, "vocab.json"), path.Join(a, "merges.txt")))
- c := must(bpe.NewTokenizerFromFiles(path.Join(b, "vocab.json"), path.Join(b, "merges.txt")))
+
+ cfg := bpe.Config{
+ Recover: true,
+ }
+
+ t := must(bpe.NewTokenizerFromFiles(path.Join(a, "vocab.json"), path.Join(a, "merges.txt"), cfg))
+ c := must(bpe.NewTokenizerFromFiles(path.Join(b, "vocab.json"), path.Join(b, "merges.txt"), cfg))
+
d := must(dataset.NewFileReader(shelf.Abs("data/babylm/train_100M"), "*.train"))
o := fmt.Sprintf(shelf.Abs("results/lesci/m000/babylm_%d_%d"), control, treatment)