-
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
File Access Guide #9154
File Access Guide #9154
Conversation
🪼 branch checks and previews
|
🦄 no changes detectedThis Pull Request does not include changes to any packages.__No changes detected. __
|
|
||
Tip: Prefer to read/write files from your prediction function in your application's local directory. But if you need to save files elsewhere, make sure that path is in `allowed_paths`. For example, if you change the default examples caching directory to be outside the current working directory. | ||
|
||
## The files Gradio will allow others to access |
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 removed the section about cached examples here because it's a little misleading and I think it's adding too much detail.
It's misleading because the files resulting from cached examples are still served from the cache, it's just that they are saved in gradio_cached_examples
before being passed to postprocess.
I think without that section the message is clearer "Gradio will serve anything in the cache + whatever you allow it to"
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 moved the content related to the GRADIO_EXAMPLES_CACHE env variable to the next guide though cause it's still important
Description
Pull out the "File Access" section from the "Sharing your App" guide into its own guide.
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Tests
PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests:
bash scripts/run_all_tests.sh
You may need to run the linters:
bash scripts/format_backend.sh
andbash scripts/format_frontend.sh