Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradio theme cache #12355

Merged
merged 1 commit into from
Aug 6, 2023
Merged

Gradio theme cache #12355

merged 1 commit into from
Aug 6, 2023

Conversation

w-e-w
Copy link
Collaborator

@w-e-w w-e-w commented Aug 6, 2023

Description

Create a cache for Gradio theme so that it doesn't have to download it every time
and it allows the theme to be loaded when offline
this is implemented by using a decorator on gr.themes.ThemeClass.from_hub

the downside of this is that the theme will not be updated automatically when the author updates the theme
so I added an option to re-download if one want
2023-08-06 10_26_20_219 chrome

cache is store under tmp/gradio_themes/<authro>_<theme>.json

Checklist:

@w-e-w w-e-w marked this pull request as draft August 6, 2023 01:31
@w-e-w

This comment was marked as outdated.

@w-e-w w-e-w marked this pull request as ready for review August 6, 2023 01:42
@w-e-w w-e-w marked this pull request as draft August 6, 2023 02:18
@w-e-w
Copy link
Collaborator Author

w-e-w commented Aug 6, 2023

found the issue
I accidentally nuke one line of code when adding in one
and it just so happens that the issue doesn't trigger on my computer
"thank you test"

@w-e-w w-e-w marked this pull request as ready for review August 6, 2023 02:28
@w-e-w
Copy link
Collaborator Author

w-e-w commented Aug 6, 2023

might be able to improve it some more

@w-e-w w-e-w marked this pull request as draft August 6, 2023 02:41
@w-e-w w-e-w force-pushed the gradio-theme-cache branch 3 times, most recently from 35d82cb to 66d5419 Compare August 6, 2023 03:13
@w-e-w w-e-w marked this pull request as ready for review August 6, 2023 03:14
@AUTOMATIC1111
Copy link
Owner

Let's swap the option and rename it to Cache gradio themes locally.

@w-e-w
Copy link
Collaborator Author

w-e-w commented Aug 6, 2023

image

@w-e-w
Copy link
Collaborator Author

w-e-w commented Aug 6, 2023

damn capitalization

@w-e-w
Copy link
Collaborator Author

w-e-w commented Aug 6, 2023

squashed

@w-e-w
Copy link
Collaborator Author

w-e-w commented Aug 6, 2023

image

@AUTOMATIC1111 AUTOMATIC1111 merged commit 2e8b400 into dev Aug 6, 2023
6 checks passed
@w-e-w w-e-w deleted the gradio-theme-cache branch August 9, 2023 06:51
@w-e-w w-e-w mentioned this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants