Skip to content

Commit

Permalink
rename Cache gradio themes locally
Browse files Browse the repository at this point in the history
  • Loading branch information
w-e-w committed Aug 6, 2023
1 parent 66d5419 commit eeca0c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def list_samplers():
options_templates.update(options_section(('ui', "User interface"), {
"localization": OptionInfo("None", "Localization", gr.Dropdown, lambda: {"choices": ["None"] + list(localization.localizations.keys())}, refresh=lambda: localization.list_localizations(cmd_opts.localizations_dir)).needs_reload_ui(),
"gradio_theme": OptionInfo("Default", "Gradio theme", ui_components.DropdownEditable, lambda: {"choices": ["Default"] + gradio_hf_hub_themes}).info("you can also manually enter any of themes from the <a href='https://huggingface.co/spaces/gradio/theme-gallery'>gallery</a>.").needs_reload_ui(),
"re_download_theme": OptionInfo(False, "Re-download the selected Gradio theme"),
"gradio_themes_cache": OptionInfo(True, "Cache gradio themes locally").info("Disable to update the selected Gradio theme"),
"return_grid": OptionInfo(True, "Show grid in results for web"),
"do_not_show_images": OptionInfo(False, "Do not show any images in results for web"),
"send_seed": OptionInfo(True, "Send seed when sending prompt or image to other interface"),
Expand Down Expand Up @@ -865,7 +865,7 @@ def reload_gradio_theme(theme_name=None):
else:
try:
theme_cache_path = os.path.join(script_path, 'tmp', 'gradio_themes', f'{theme_name.replace("/", "_")}.json')
if not opts.re_download_theme and os.path.exists(theme_cache_path):
if opts.gradio_themes_cache and os.path.exists(theme_cache_path):
gradio_theme = gr.themes.ThemeClass.load(theme_cache_path)
else:
gradio_theme = gr.themes.ThemeClass.from_hub(theme_name)
Expand Down

0 comments on commit eeca0c6

Please sign in to comment.