Spaces:
Running
Running
Commit
·
0548509
1
Parent(s):
efa06b4
Small refactor: Add `config` with model metadata and move constants to its own file
Browse files- app.py +27 -2
- src/data_processing.py → data_processing.py +0 -0
app.py
CHANGED
|
@@ -6,8 +6,7 @@ from gradio.themes.utils import colors
|
|
| 6 |
from config import constants as C
|
| 7 |
from handlers.leaderboard_handlers import create_leaderboard_handlers
|
| 8 |
from results.parse import get_metadata, parse_agg, read_dataframe
|
| 9 |
-
from
|
| 10 |
-
from src.models import Simulator
|
| 11 |
from static.about import CITATION_BUTTON_LABEL, CITATION_BUTTON_TEXT
|
| 12 |
from static.html_content import (
|
| 13 |
ABOUT_US_HTML,
|
|
@@ -19,6 +18,7 @@ from static.html_content import (
|
|
| 19 |
)
|
| 20 |
from style.css_html_js import custom_css
|
| 21 |
|
|
|
|
| 22 |
with gr.Blocks(css=custom_css, theme=gr.themes.Default(primary_hue=colors.emerald)) as app:
|
| 23 |
# Load csv results
|
| 24 |
df_icarus = read_dataframe(C.ICARUS_RESULTS)
|
|
@@ -175,6 +175,31 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Default(primary_hue=colors.emeral
|
|
| 175 |
)
|
| 176 |
|
| 177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
app.launch(
|
| 179 |
allowed_paths=[
|
| 180 |
"logo_new.png",
|
|
|
|
| 6 |
from config import constants as C
|
| 7 |
from handlers.leaderboard_handlers import create_leaderboard_handlers
|
| 8 |
from results.parse import get_metadata, parse_agg, read_dataframe
|
| 9 |
+
from data_processing import filter_leaderboard, generate_scatter_plot
|
|
|
|
| 10 |
from static.about import CITATION_BUTTON_LABEL, CITATION_BUTTON_TEXT
|
| 11 |
from static.html_content import (
|
| 12 |
ABOUT_US_HTML,
|
|
|
|
| 18 |
)
|
| 19 |
from style.css_html_js import custom_css
|
| 20 |
|
| 21 |
+
|
| 22 |
with gr.Blocks(css=custom_css, theme=gr.themes.Default(primary_hue=colors.emerald)) as app:
|
| 23 |
# Load csv results
|
| 24 |
df_icarus = read_dataframe(C.ICARUS_RESULTS)
|
|
|
|
| 175 |
)
|
| 176 |
|
| 177 |
|
| 178 |
+
# this is just a simple class to load the correct data depending on which sim we are at
|
| 179 |
+
class Simulator:
|
| 180 |
+
def __init__(self, icarus_df, icarus_agg, verilator_df, verilator_agg):
|
| 181 |
+
self.icarus_df = icarus_df
|
| 182 |
+
self.icarus_agg = icarus_agg
|
| 183 |
+
self.verilator_df = verilator_df
|
| 184 |
+
self.verilator_agg = verilator_agg
|
| 185 |
+
self.current_simulator = "Icarus"
|
| 186 |
+
|
| 187 |
+
def get_current_df(self):
|
| 188 |
+
if self.current_simulator == "Icarus":
|
| 189 |
+
return self.icarus_df
|
| 190 |
+
else:
|
| 191 |
+
return self.verilator_df
|
| 192 |
+
|
| 193 |
+
def get_current_agg(self):
|
| 194 |
+
if self.current_simulator == "Icarus":
|
| 195 |
+
return self.icarus_agg
|
| 196 |
+
else:
|
| 197 |
+
return self.verilator_agg
|
| 198 |
+
|
| 199 |
+
def set_simulator(self, simulator):
|
| 200 |
+
self.current_simulator = simulator
|
| 201 |
+
|
| 202 |
+
|
| 203 |
app.launch(
|
| 204 |
allowed_paths=[
|
| 205 |
"logo_new.png",
|
src/data_processing.py → data_processing.py
RENAMED
|
File without changes
|