RFTSystems's picture
Create app.py
a9350c3 verified
Raw
History Blame
1.02 kB
import gradio as gr
import json
import time
# Load results
with open("results.json") as f:
data = json.load(f)
def simulate_epochs(dataset):
results = data[dataset]
table = "| Epoch | LIAM (RFT) | Adam | Lion | SGR |\n|-------|-------------|------|------|-----|\n"
markdown_output = ""
for i in range(len(results["epochs"])):
epoch = results["epochs"][i]
rft = results["LIAM_RFT"][i]
adam = results["Adam"][i]
lion = results["Lion"][i]
sgr = results["SGR"][i]
table += f"| {epoch} | {rft:.2f}% | {adam:.2f}% | {lion:.2f}% | {sgr:.2f}% |\n"
markdown_output = table
yield markdown_output
time.sleep(0.75)
demo = gr.Interface(
fn=simulate_epochs,
inputs=gr.Dropdown(choices=list(data.keys()), label="Select Dataset"),
outputs=gr.Markdown(),
title="RFT Optimizer Showdown",
description="Epoch-by-epoch simulation of optimizer performance. All results sealed and verified.",
live=True
)
demo.launch()