How to publish files which are not in gradio's folder

Sometimes we need to publish models or some other files which are not in the path of gradio. How can I do that? From my thought, I think there maybe some ways:

  • Create symbol link in gradio’s folder which point to the real files, then publish these symbol links
  • Create anther web service to control those files, and gradio use the http address to publish

I don’t know which one is the common solutions, may you help me? Or, if there’s some other solutions for me to learn.

Thank you all

1 Like

I’m not sure whether it’s a local or HF Spaces, but if it’s Spaces, I think the latter is easier. Especially if it’s a download from HF to HF, it’s very fast, and if you use the official HF functions, there’s not much overhead.
Gradio is particularly strict about security after version 5, so referencing external paths that are not under the app folder generally takes a lot of effort…

Thank you for this reply. Maybe I have wrong description on my workshop. I just want to share my app in LAN, and some files which are not in the base path of my gradio app, how can I share those files in the output html serviced by gradio?

1 Like

I see. So it’s used over a LAN. I think this is probably how it’s set up.

However, even after allowing it with allowed_path, I think the naming conventions for Gradio file URLs are a little unusual. Well, if you know about them, you can deal with them. If there are no security concerns, there is also a way to share directories separately, independently of Gradio.