Spaces:
Runtime error
Runtime error
fix webui
Browse files
webui.py
CHANGED
@@ -115,15 +115,16 @@ def remove_darkness(stylable):
|
|
115 |
"""
|
116 |
Patch gradio to only contain light mode colors.
|
117 |
"""
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
|
|
127 |
|
128 |
def build_ui(model=list(models)[0], lock=False, rasterize=False, force_light=False, lock_reason="locked", timeout=120):
|
129 |
theme = remove_darkness(gr.themes.Soft()) if force_light else gr.themes.Soft()
|
|
|
115 |
"""
|
116 |
Patch gradio to only contain light mode colors.
|
117 |
"""
|
118 |
+
pass # TODO: remove dark mode colors from the theme
|
119 |
+
# if isinstance(stylable, gr.themes.Base): # remove dark variants from the entire theme
|
120 |
+
# params = signature(stylable.set).parameters
|
121 |
+
# colors = {color: getattr(stylable, color.removesuffix("_dark")) for color in dir(stylable) if color in params}
|
122 |
+
# return stylable.set(**colors)
|
123 |
+
# elif isinstance(stylable, gr.Blocks): # also handle components which do not use the theme (e.g. modals)
|
124 |
+
# stylable.load(_js="() => document.querySelectorAll('.dark').forEach(el => el.classList.remove('dark'))")
|
125 |
+
# return stylable
|
126 |
+
# else:
|
127 |
+
# raise ValueError
|
128 |
|
129 |
def build_ui(model=list(models)[0], lock=False, rasterize=False, force_light=False, lock_reason="locked", timeout=120):
|
130 |
theme = remove_darkness(gr.themes.Soft()) if force_light else gr.themes.Soft()
|