Requested changes
This commit is contained in:
parent
867be74244
commit
5afc44aab1
@ -665,20 +665,19 @@ def reload_gradio_theme(theme_name=None):
|
|||||||
if not theme_name:
|
if not theme_name:
|
||||||
theme_name = opts.gradio_theme
|
theme_name = opts.gradio_theme
|
||||||
|
|
||||||
if theme_name == "Default":
|
default_theme_args = dict(
|
||||||
gradio_theme = gr.themes.Default(
|
font=["Source Sans Pro", 'ui-sans-serif', 'system-ui', 'sans-serif'],
|
||||||
font=['Helvetica', 'ui-sans-serif', 'system-ui', 'sans-serif'],
|
|
||||||
font_mono=['IBM Plex Mono', 'ui-monospace', 'Consolas', 'monospace'],
|
font_mono=['IBM Plex Mono', 'ui-monospace', 'Consolas', 'monospace'],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if theme_name == "Default":
|
||||||
|
gradio_theme = gr.themes.Default(**default_theme_args)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
gradio_theme = gr.themes.ThemeClass.from_hub(theme_name)
|
gradio_theme = gr.themes.ThemeClass.from_hub(theme_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
errors.display(e, "changing gradio theme")
|
errors.display(e, "changing gradio theme")
|
||||||
gradio_theme = gr.themes.Default(
|
gradio_theme = gr.themes.Default(**default_theme_args)
|
||||||
font=['Helvetica', 'ui-sans-serif', 'system-ui', 'sans-serif'],
|
|
||||||
font_mono=['IBM Plex Mono', 'ui-monospace', 'Consolas', 'monospace'],
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
/* temporary fix to load default gradio font in frontend instead of backend */
|
||||||
|
|
||||||
|
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600&display=swap');
|
||||||
|
|
||||||
/* general gradio fixes */
|
/* general gradio fixes */
|
||||||
|
|
||||||
|
9
webui.py
9
webui.py
@ -28,15 +28,8 @@ warnings.filterwarnings(action="ignore", category=UserWarning, module="torchvisi
|
|||||||
|
|
||||||
startup_timer.record("import torch")
|
startup_timer.record("import torch")
|
||||||
|
|
||||||
import requests
|
|
||||||
def gradio_get(url, **kwargs):
|
|
||||||
kwargs.setdefault('allow_redirects', True)
|
|
||||||
return requests.api.request('get', 'http://127.0.0.1/', **kwargs)
|
|
||||||
|
|
||||||
original_get = requests.get
|
|
||||||
requests.get = gradio_get
|
|
||||||
import gradio
|
import gradio
|
||||||
requests.get = original_get
|
startup_timer.record("import gradio")
|
||||||
|
|
||||||
startup_timer.record("import gradio")
|
startup_timer.record("import gradio")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user