aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcatboxanon <122327233+catboxanon@users.noreply.github.com>2023-05-13 12:57:32 +0000
committercatboxanon <122327233+catboxanon@users.noreply.github.com>2023-05-13 12:57:32 +0000
commit5afc44aab14819afea87b2f36c2f76dc43d3e83c (patch)
treef5c74d8995bbe7f45f1ee7c56a72f41c9a158ecd
parent867be74244dc725fcf2685018b97501e83a16235 (diff)
Requested changes
-rw-r--r--modules/shared.py15
-rw-r--r--style.css3
-rw-r--r--webui.py9
3 files changed, 11 insertions, 16 deletions
diff --git a/modules/shared.py b/modules/shared.py
index b09b384e..96a20a6b 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -665,20 +665,19 @@ def reload_gradio_theme(theme_name=None):
if not theme_name:
theme_name = opts.gradio_theme
+ default_theme_args = dict(
+ font=["Source Sans Pro", 'ui-sans-serif', 'system-ui', 'sans-serif'],
+ font_mono=['IBM Plex Mono', 'ui-monospace', 'Consolas', 'monospace'],
+ )
+
if theme_name == "Default":
- gradio_theme = gr.themes.Default(
- font=['Helvetica', 'ui-sans-serif', 'system-ui', 'sans-serif'],
- font_mono=['IBM Plex Mono', 'ui-monospace', 'Consolas', 'monospace'],
- )
+ gradio_theme = gr.themes.Default(**default_theme_args)
else:
try:
gradio_theme = gr.themes.ThemeClass.from_hub(theme_name)
except Exception as e:
errors.display(e, "changing gradio theme")
- gradio_theme = gr.themes.Default(
- font=['Helvetica', 'ui-sans-serif', 'system-ui', 'sans-serif'],
- font_mono=['IBM Plex Mono', 'ui-monospace', 'Consolas', 'monospace'],
- )
+ gradio_theme = gr.themes.Default(**default_theme_args)
diff --git a/style.css b/style.css
index 4ac919b5..8c7be275 100644
--- a/style.css
+++ b/style.css
@@ -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 */
diff --git a/webui.py b/webui.py
index cdb96740..d3aafe6d 100644
--- a/webui.py
+++ b/webui.py
@@ -28,15 +28,8 @@ warnings.filterwarnings(action="ignore", category=UserWarning, module="torchvisi
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
-requests.get = original_get
+startup_timer.record("import gradio")
startup_timer.record("import gradio")