18 lines
574 B
Python
18 lines
574 B
Python
from datetime import datetime
|
|
|
|
class RubyState:
|
|
def __init__(self):
|
|
self.last_message_time = datetime.utcnow()
|
|
self.current_activity = "Booting up..."
|
|
self.latest_thoughts = []
|
|
self.latest_losses = []
|
|
self.vocab_size = 0
|
|
|
|
def log_thought(self, thought):
|
|
self.latest_thoughts.append((datetime.utcnow(), thought))
|
|
self.latest_thoughts = self.latest_thoughts[-10:]
|
|
|
|
def log_loss(self, value):
|
|
self.latest_losses.append((datetime.utcnow(), value))
|
|
self.latest_losses = self.latest_losses[-10:]
|