fix an issue preventing the program from starting if the user specifies a bad gradio theme
This commit is contained in:
parent
921dc4639b
commit
d50b95b5a3
|
@ -672,8 +672,8 @@ def reload_gradio_theme(theme_name=None):
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
gradio_theme = gr.themes.ThemeClass.from_hub(theme_name)
|
gradio_theme = gr.themes.ThemeClass.from_hub(theme_name)
|
||||||
except requests.exceptions.ConnectionError:
|
except Exception as e:
|
||||||
print("Can't access HuggingFace Hub, falling back to default Gradio theme")
|
errors.display(e, "changing gradio theme")
|
||||||
gradio_theme = gr.themes.Default()
|
gradio_theme = gr.themes.Default()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue