diff --git a/.gitignore b/.gitignore index 4f5689d..de082cc 100644 --- a/.gitignore +++ b/.gitignore @@ -169,8 +169,7 @@ cython_debug/ #.idea/ .vscode/launch.json -/data/books/alice_in_wonderland.txt -/data/books/wizard_of_oz.txt +/data/books/* /data/memory/context.json /data/memory/dreams.json data/memory/brainmap.json diff --git a/dashboard/dashboard.py b/dashboard/dashboard.py index 6ede7f0..a49acd3 100644 --- a/dashboard/dashboard.py +++ b/dashboard/dashboard.py @@ -10,6 +10,7 @@ from context.context import load_context import json import os import time +import datetime app = Flask(__name__) @@ -27,6 +28,21 @@ def load_loss_data(): return [float(line.strip().split(",")[1]) for line in lines[-50:]] +def load_vocab_growth(): + path = "data/logs/vocab_growth.log" + if not os.path.exists(path): + return [] + with open(path, "r", encoding="utf-8") as f: + lines = f.readlines() + data = [] + for line in lines: + timestamp, vocab_size = line.strip().split(",") + # Reformat timestamp to human-readable + readable_time = datetime.datetime.fromtimestamp(float(timestamp)).strftime("%H:%M:%S") + data.append((readable_time, int(vocab_size))) + return data + + def update_next_cycle(seconds): global next_cycle_time next_cycle_time = time.time() + seconds @@ -55,10 +71,13 @@ def growth(): vocab_size = len(tokenizer.vocab) brainmap_size = len(get_brainmap()) memory_size = len(load_context()) + vocab_growth = load_vocab_growth() + return render_template("growth.html", vocab_size=vocab_size, brainmap_size=brainmap_size, - memory_size=memory_size) + memory_size=memory_size, + vocab_growth=vocab_growth) @app.route("/brainmap") diff --git a/dashboard/templates/growth.html b/dashboard/templates/growth.html index c644dcf..b7b0cf8 100644 --- a/dashboard/templates/growth.html +++ b/dashboard/templates/growth.html @@ -2,6 +2,7 @@ + Ruby's Brain Growth