Open crypdick opened 10 hours ago
Please share your app so we can reproduce @crypdick !
@freddyaboulton here is a stub, you'll have to update it for your system.
import gradio as gr
my_gallery = gr.Gallery()
btn = gr.Button()
def generate_gallery():
return ["/home/richard/path/to/img/pardir/sub1/dir1/1.png", "/home/richard/path/to/img/pardir/sub2/dir2/2.png"]
btn.click(generate_gallery, inputs=[], outputs=[my_gallery]
demo.launch(allowed_paths=["/home/richard/path/to/img/pardir/"])
Very strange - I can't repro @crypdick . Just tried on 5.1.0.
https://github.com/user-attachments/assets/28c77026-ce28-41df-9c27-264deee15a12
@freddyaboulton in your screencast, the images are in the root of the par dir. In my case, the images are nested under about 10 subdirs below the pardir.
I just moved the images to be several directories down in ~/Pictures
and I don't get the error you're getting.
https://github.com/user-attachments/assets/33905c9f-fb8e-424f-bafa-29c0cc845b62
Describe the bug
The documentation for
allowed_paths
states:However, when I add the absolute path to a parent directory to
allowed_paths
, my app is still raisinggradio.exceptions.InvalidPathError
. In particular, I am trying to display agr.Gallery
of images where the images are nested in a subdirectories of my allowed path.Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
System Info
Severity
I can work around it