Open Liusuthu opened 3 weeks ago
We'll take a look. Related: https://github.com/gradio-app/gradio/issues/9350
Have you tried setting something like every=1
so like gr.FileExplorer(root_dir="./chat_data",file_count="single",interactive=True, every=1)
, which I think should refresh the contents every second?
Thanks for your reply! I did try it, but nothing worked.
You can reproduce this error as follows:
import gradio as gr
with gr.Blocks() as demo:
show_files=gr.FileExplorer(root_dir="./chat_data",file_count="single",interactive=True, every=1)
demo.launch()
I just manually add/delete files in ./chat_date
folder, and the content can't be refreshed per second.
By the way, my gradio version is 4.44.1, but I also tried 5.3.0 and the problem exists.
Describe the bug
Hey dear developers, I'm not sure whether it's a bug, but it really stresses me out.
In my codes, I want to use the component FileExplorer to view my files realtime, since I will dynamically create and delete files. But I find that the displayed content in FileExploere can't change realtime after I add or delete a file. The core code can be describe simply below:
After a simple experiment, I think it's because the original
root_dir
is the same after flush, so the content won't change, if I make root_dir a different path, it will reflect the new changes. But it's really annoying.So is there any solution if I still want to use this component for realtime viewing my files? Thank you!
I have tried the existing methods in #6096 by abidlabs, and also tried #9350 and #7788 but nothing works.
Have you searched existing issues? š
Reproduction
Screenshot
None
Logs
System Info
Severity
I can work around it