gradio: Gallery front-end cannot display a url from web
Describe the bug
I found the Gallery
front-end cannot display a url from web. It seems a strange prefix url is added to the front.
example:
<src="https://zb-dsw-dsw32719-80.pcs-svr.alibaba-inc.com/dsw32719/proxy/7862/file=https://images.unsplash.com/photo-1554151228-14d9def656e4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=386&q=80">
The image I want to reach is from the url https://images.unsplash.com/photo-1554151228-14d9def656e4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=386&q=80
. But the prefix added prevents the browser to render the image correctly.
Have you searched existing issues? 🔎
- I have searched and found no existing issues
Reproduction
import random
import gradio as gr
with gr.Blocks() as demo:
gallery = gr.Gallery(value=["https://images.unsplash.com/photo-1554151228-14d9def656e4?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=386&q=80"], preview=True)
demo.launch(root_path='')
Screenshot
No response
Logs
No response
System Info
any
Severity
Blocking usage of gradio
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (4 by maintainers)
Hi @ivan-mihailov, I think I know the issue. To set the version of
gradio
on Hugging Face Spaces, you actually need to set thesdk_version
in theREADME.md
file, not in the requirement.txt. Thesdk_version
takes priority. If you set it to 3.47.1, it should work!