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
Modify the behavior of delete_cache
so that only files that are not being used by any active sessions are deleted
#8098
Comments
Hi @mberco-quandl , Gradio does not save files independently for each session hash. The hash you see ( The Why don't you want to use |
Ah interesting. Would a collision occur if two sessions uploaded different files with the same names? What if there is no intention of sharing tmp files between sessions? The issue is less control in a space-constrained deployment. In my application I know that users have no need to share files cross-session or to access files after closing a connection. I'd like users to be able to access files as long as the connection is open, however. My understanding is that Thank you! |
@freddyaboulton would it be possible to modify the behavior of delete_cache so that only files that are not being used by any active sessions are deleted? Based on the heartbeat connection. |
@freddyaboulton @abidlabs what is the supported way to write files to the temp directory? Performing an operation on a pandas dataframe like Thanks! |
Hi @mberco-quandl we don't support explicitly writing files to the cache. I don't quite follow why you need to do this. I'm going to rename this issue to this:
|
delete_cache
so that only files that are not being used by any active sessions are deleted
Is your feature request related to a problem? Please describe.
Difficulty applying the unload event listener to storage management. I would like two behaviours: 1) the ability to delete specific Gradio.Files and 2) the ability to delete the entire temporary directory associated with a session (eg "root:/tmp/gradio/c2ab059f2860eee1b4963a90a6815042e18404e4/").
Feature 1) - why doesn't .unload support inputs? In my testing it's impossible to access a Gradio.File path without passing it in as an input to the function triggered by unload. Being able to control specific files that get deleted upon connection termination would be desirable.
Feature 2) - even if I knew how to access the string "c2ab059f2860eee1b4963a90a6815042e18404e4" associated with my session ID, how would I then pass that into the function triggered by unload? Being able to clear the temporary storage associated with a session would be desirable.
@freddyaboulton helpfully suggested unload as a solution to storage leaks here but I can't apply it given the shortcomings. Any workarounds? Am I missing something?
Describe the solution you'd like
Additional context
Thank you!
The text was updated successfully, but these errors were encountered: