trinity.buffer.viewer module#
- class trinity.buffer.viewer.SQLExperienceViewer(config: StorageConfig)[source]#
Bases:
object- __init__(config: StorageConfig) None[source]#
- get_experiences(offset: int, limit: int = 10) List[Experience][source]#
- static run_viewer(model_path: str, db_url: str, table_name: str, port: int)[source]#
Start the Streamlit viewer.
- Parameters:
model_path (str) β Path to the tokenizer/model directory.
db_url (str) β Database URL for the experience database.
table_name (str) β Name of the experience table in the database.
port (int) β Port number to run the Streamlit app on.
- trinity.buffer.viewer.get_color_for_action_mask(action_mask_value: int) str[source]#
Return color based on action_mask value
- trinity.buffer.viewer.render_experience(exp: Experience, tokenizer)[source]#
Render a single experience sequence in Streamlit.