waleko commited on
Commit
4c4ca38
·
1 Parent(s): 673cd4d
Files changed (1) hide show
  1. webui.py +10 -9
webui.py CHANGED
@@ -115,15 +115,16 @@ def remove_darkness(stylable):
115
  """
116
  Patch gradio to only contain light mode colors.
117
  """
118
- if isinstance(stylable, gr.themes.Base): # remove dark variants from the entire theme
119
- params = signature(stylable.set).parameters
120
- colors = {color: getattr(stylable, color.removesuffix("_dark")) for color in dir(stylable) if color in params}
121
- return stylable.set(**colors)
122
- elif isinstance(stylable, gr.Blocks): # also handle components which do not use the theme (e.g. modals)
123
- stylable.load(_js="() => document.querySelectorAll('.dark').forEach(el => el.classList.remove('dark'))")
124
- return stylable
125
- else:
126
- raise ValueError
 
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()