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

Small changes to caching #9438

Merged
merged 9 commits into from
Sep 26, 2024
Merged

Small changes to caching #9438

merged 9 commits into from
Sep 26, 2024

Conversation

abidlabs
Copy link
Member

Based on feedback from @apolinario (internal link), tweaked the cache_examples parameter to throw a warning instead of an exception if cache_examples="lazy"

@abidlabs abidlabs changed the base branch from main to 5.0-dev September 25, 2024 01:04
@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Sep 25, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/91b1c7099a1aea2bec26da35a98df85434f5a369/gradio-4.44.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@91b1c7099a1aea2bec26da35a98df85434f5a369#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/91b1c7099a1aea2bec26da35a98df85434f5a369/gradio-client-1.6.0-beta.3.tgz

Use Lite from this PR

<script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/91b1c7099a1aea2bec26da35a98df85434f5a369/dist/lite.js""></script>

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Sep 25, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Small changes to caching

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

Comment on lines 148 to 149
elif utils.get_space() and fn is not None and outputs is not None:
self.cache_examples = True
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also got rid of this logic and instead set the GRADIO_CACHE_EXAMPLES env in the Spaces Dockerfile: https://github.com/huggingface-internal/workloads/pull/2379

Copy link
Collaborator

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with not raising an exception. Have a question about what value we set for cached examples in that case.

)
elif cache_examples == "lazy":
warnings.warn(
"The `cache_examples` parameter no longer accepts a value of 'lazy'. To enable lazy caching in "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not enable lazy caching in this case instead of not caching at all since we're soft deprecating?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's fair actually, I'll make the change

@abidlabs abidlabs merged commit 8f469e1 into 5.0-dev Sep 26, 2024
19 of 20 checks passed
@abidlabs abidlabs deleted the caching-changes branch September 26, 2024 21:49
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.

3 participants