Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,6 @@ from sklearn.ensemble import RandomForestClassifier
|
|
20 |
from sklearn.naive_bayes import GaussianNB
|
21 |
from sklearn.metrics import accuracy_score
|
22 |
|
23 |
-
|
24 |
# Suppress TensorFlow warnings
|
25 |
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
|
26 |
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
|
@@ -274,17 +273,16 @@ with gr.Blocks() as app:
|
|
274 |
|
275 |
# Theme changing logic
|
276 |
theme_dropdown.change(
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
_js=f"""
|
281 |
-
(theme) => {{
|
282 |
-
let themeElem = document.createElement('link');
|
283 |
themeElem.rel = 'stylesheet';
|
284 |
-
themeElem.href = '/themes/' + theme + '.css';
|
285 |
document.head.appendChild(themeElem);
|
286 |
}}
|
287 |
-
"""
|
|
|
|
|
288 |
)
|
289 |
|
290 |
toggle_dark.click(None, _js="""
|
|
|
20 |
from sklearn.naive_bayes import GaussianNB
|
21 |
from sklearn.metrics import accuracy_score
|
22 |
|
|
|
23 |
# Suppress TensorFlow warnings
|
24 |
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
|
25 |
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
|
|
|
273 |
|
274 |
# Theme changing logic
|
275 |
theme_dropdown.change(
|
276 |
+
lambda theme: f"""
|
277 |
+
() => {{
|
278 |
+
const themeElem = document.createElement('link');
|
|
|
|
|
|
|
279 |
themeElem.rel = 'stylesheet';
|
280 |
+
themeElem.href = '/themes/' + theme + '.css'; // Path to the theme CSS files
|
281 |
document.head.appendChild(themeElem);
|
282 |
}}
|
283 |
+
""",
|
284 |
+
inputs=theme_dropdown,
|
285 |
+
outputs=[]
|
286 |
)
|
287 |
|
288 |
toggle_dark.click(None, _js="""
|