from flask import Flask, render_template_string from datetime import datetime import os app = Flask(__name__) @app.route("/") def home(): dreams = [] if os.path.exists("logs/dreams.log"): with open("logs/dreams.log", encoding="utf-8") as f: dreams = [line.strip() for line in f.readlines()[-10:]] messages = [] if os.path.exists("logs/messages.log"): with open("logs/messages.log", encoding="utf-8") as f: messages = [line.strip() for line in f.readlines()[-10:]] vocab_size = 0 if os.path.exists("tokenizer_vocab.txt"): with open("tokenizer_vocab.txt", encoding="utf-8") as f: vocab_size = sum(1 for _ in f) return render_template_string("""
Vocabulary Size: {{ vocab_size }}