RFTSystems commited on
Commit
a9350c3
·
verified ·
1 Parent(s): 63dd8a8

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -0
app.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import json
3
+ import time
4
+
5
+ # Load results
6
+ with open("results.json") as f:
7
+ data = json.load(f)
8
+
9
+ def simulate_epochs(dataset):
10
+ results = data[dataset]
11
+ table = "| Epoch | LIAM (RFT) | Adam | Lion | SGR |\n|-------|-------------|------|------|-----|\n"
12
+ markdown_output = ""
13
+ for i in range(len(results["epochs"])):
14
+ epoch = results["epochs"][i]
15
+ rft = results["LIAM_RFT"][i]
16
+ adam = results["Adam"][i]
17
+ lion = results["Lion"][i]
18
+ sgr = results["SGR"][i]
19
+ table += f"| {epoch} | {rft:.2f}% | {adam:.2f}% | {lion:.2f}% | {sgr:.2f}% |\n"
20
+ markdown_output = table
21
+ yield markdown_output
22
+ time.sleep(0.75)
23
+
24
+ demo = gr.Interface(
25
+ fn=simulate_epochs,
26
+ inputs=gr.Dropdown(choices=list(data.keys()), label="Select Dataset"),
27
+ outputs=gr.Markdown(),
28
+ title="RFT Optimizer Showdown",
29
+ description="Epoch-by-epoch simulation of optimizer performance. All results sealed and verified.",
30
+ live=True
31
+ )
32
+
33
+ demo.launch()