Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Switch to light theme.
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@
|
|
3 |
import gradio as gr
|
4 |
import pandas as pd
|
5 |
from apscheduler.schedulers.background import BackgroundScheduler
|
6 |
-
from gradio.themes import Base, colors, sizes
|
7 |
from gradio_leaderboard import Leaderboard, SelectColumns
|
8 |
from huggingface_hub import whoami
|
9 |
|
@@ -83,7 +82,6 @@ def init_leaderboard(dataframe: pd.DataFrame):
|
|
83 |
def add_solution_cbk(
|
84 |
system_name: str,
|
85 |
org: str,
|
86 |
-
# sys_type: str, # This was commented out in your version
|
87 |
submission_path: str,
|
88 |
profile: gr.OAuthProfile | None,
|
89 |
oauth_token: gr.OAuthToken | None,
|
@@ -125,12 +123,11 @@ def add_solution_cbk(
|
|
125 |
return styled_error("Failed to read JSONL submission file. Please try again later.")
|
126 |
|
127 |
# Validating all user-supplied arguments.
|
128 |
-
# I am adding a placeholder for sys_type since your original add_new_solutions call expects it
|
129 |
sys_type = "default" # Placeholder
|
130 |
for val, val_name in [
|
131 |
(system_name, "System name"),
|
132 |
(org, "Organisation name"),
|
133 |
-
# (sys_type, "System type"),
|
134 |
]:
|
135 |
if len(val) == 0:
|
136 |
return styled_error(f"Please fill in the '{val_name}' field.")
|
@@ -176,20 +173,18 @@ def gate_submission(oauth_token: gr.OAuthToken | None):
|
|
176 |
|
177 |
|
178 |
def get_theme():
|
179 |
-
# MODIFICATION: Switched to a light theme
|
180 |
return gr.themes.Soft(
|
181 |
primary_hue=gr.themes.colors.blue,
|
182 |
secondary_hue=gr.themes.colors.sky,
|
183 |
neutral_hue=gr.themes.colors.gray,
|
184 |
).set(
|
185 |
body_background_fill="#FFFFFF",
|
186 |
-
panel_background_fill="#f3f4f6",
|
187 |
)
|
188 |
|
189 |
|
190 |
blocks = gr.Blocks(css=custom_css, theme=get_theme())
|
191 |
with blocks:
|
192 |
-
# MODIFICATION: Banner gr.Image call is removed.
|
193 |
|
194 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
195 |
with gr.TabItem("What is FormulaOne", id=0):
|
@@ -226,7 +221,6 @@ with blocks:
|
|
226 |
submit_button = gr.Button("Submit", variant="primary")
|
227 |
submission_result = gr.Markdown()
|
228 |
|
229 |
-
# Using your original .click() call which does not include sys_type_dropdown
|
230 |
submit_button.click(
|
231 |
add_solution_cbk,
|
232 |
[
|
|
|
3 |
import gradio as gr
|
4 |
import pandas as pd
|
5 |
from apscheduler.schedulers.background import BackgroundScheduler
|
|
|
6 |
from gradio_leaderboard import Leaderboard, SelectColumns
|
7 |
from huggingface_hub import whoami
|
8 |
|
|
|
82 |
def add_solution_cbk(
|
83 |
system_name: str,
|
84 |
org: str,
|
|
|
85 |
submission_path: str,
|
86 |
profile: gr.OAuthProfile | None,
|
87 |
oauth_token: gr.OAuthToken | None,
|
|
|
123 |
return styled_error("Failed to read JSONL submission file. Please try again later.")
|
124 |
|
125 |
# Validating all user-supplied arguments.
|
|
|
126 |
sys_type = "default" # Placeholder
|
127 |
for val, val_name in [
|
128 |
(system_name, "System name"),
|
129 |
(org, "Organisation name"),
|
130 |
+
# (sys_type, "System type"),
|
131 |
]:
|
132 |
if len(val) == 0:
|
133 |
return styled_error(f"Please fill in the '{val_name}' field.")
|
|
|
173 |
|
174 |
|
175 |
def get_theme():
|
|
|
176 |
return gr.themes.Soft(
|
177 |
primary_hue=gr.themes.colors.blue,
|
178 |
secondary_hue=gr.themes.colors.sky,
|
179 |
neutral_hue=gr.themes.colors.gray,
|
180 |
).set(
|
181 |
body_background_fill="#FFFFFF",
|
182 |
+
panel_background_fill="#f3f4f6",
|
183 |
)
|
184 |
|
185 |
|
186 |
blocks = gr.Blocks(css=custom_css, theme=get_theme())
|
187 |
with blocks:
|
|
|
188 |
|
189 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
190 |
with gr.TabItem("What is FormulaOne", id=0):
|
|
|
221 |
submit_button = gr.Button("Submit", variant="primary")
|
222 |
submission_result = gr.Markdown()
|
223 |
|
|
|
224 |
submit_button.click(
|
225 |
add_solution_cbk,
|
226 |
[
|