Spaces:
Sleeping
Sleeping
abrakjamson
commited on
Commit
•
5f7f1fd
1
Parent(s):
3379490
dark mode toggle
Browse files
app.py
CHANGED
@@ -426,6 +426,7 @@ with gr.Blocks(
|
|
426 |
show_label=False,
|
427 |
label="do_sample"
|
428 |
)
|
|
|
429 |
|
430 |
# Right Column: Chat Interface
|
431 |
with gr.Column(scale=2):
|
@@ -543,5 +544,14 @@ with gr.Blocks(
|
|
543 |
outputs=control_checks + control_sliders
|
544 |
)
|
545 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
546 |
if __name__ == "__main__":
|
547 |
app.launch()
|
|
|
426 |
show_label=False,
|
427 |
label="do_sample"
|
428 |
)
|
429 |
+
toggle_dark = gr.Button(value="Toggle Dark Mode")
|
430 |
|
431 |
# Right Column: Chat Interface
|
432 |
with gr.Column(scale=2):
|
|
|
544 |
outputs=control_checks + control_sliders
|
545 |
)
|
546 |
|
547 |
+
toggle_dark.click(
|
548 |
+
None,
|
549 |
+
js="""
|
550 |
+
() => {
|
551 |
+
document.body.classList.toggle('dark');
|
552 |
+
}
|
553 |
+
""",
|
554 |
+
)
|
555 |
+
|
556 |
if __name__ == "__main__":
|
557 |
app.launch()
|