-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Small changes to caching #9438
Conversation
🪼 branch checks and previews
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> |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
gradio/helpers.py
Outdated
elif utils.get_space() and fn is not None and outputs is not None: | ||
self.cache_examples = True |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
gradio/helpers.py
Outdated
) | ||
elif cache_examples == "lazy": | ||
warnings.warn( | ||
"The `cache_examples` parameter no longer accepts a value of 'lazy'. To enable lazy caching in " |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Based on feedback from @apolinario (internal link), tweaked the
cache_examples
parameter to throw a warning instead of an exception ifcache_examples="lazy"