Skip to content
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

gradio url error when downloading an image using bash #9317

Open
1 task done
not-lain opened this issue Sep 11, 2024 · 1 comment
Open
1 task done

gradio url error when downloading an image using bash #9317

not-lain opened this issue Sep 11, 2024 · 1 comment
Labels
bug Something isn't working gradio_client Related to the one of the gradio client libraries

Comments

@not-lain
Copy link

Describe the bug

some images are not being downloaded from my space because the proposed data["url"] after calling the api from the terminal says https://abc.spa/file=xyz , the api says spa and not space .

this was also reported in https://huggingface.co/spaces/not-lain/background-removal/discussions/8

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

curl -X POST https://not-lain-background-removal.hf.space/call/png -s -H "Content-Type: application/json" -d '{
  "data": [
                                                        {"path":"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png"}
]}'   | awk -F'"' '{ print $4}'    | { read event; curl -s "https://not-lain-background-removal.hf.space/call/png/$event" | grep -oEi '"url": ".*?"' | awk -F'"' '{print $4}'  ;    }

returns

https://not-lain-background-removal.hf.spa/file=/tmp/gradio/f5fd5dce8ca182c6d5fcc64c684e99e658ef7b6d9699f36594a1c64faab5ee7c/image.png

you can also do

curl -X POST https://not-lain-background-removal.hf.space/call/png -s -H "Content-Type: application/json" -d '{
  "data": [
                                                        {"path":"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png"}
]}'   | awk -F'"' '{ print $4}'

will print $event
now open https://not-lain-background-removal.hf.space/call/png/$event
when I opened mine I found the following

event: complete
data: [{"path": "/tmp/gradio/f5fd5dce8ca182c6d5fcc64c684e99e658ef7b6d9699f36594a1c64faab5ee7c/image.png", "url": "https://not-lain-background-removal.hf.spa/file=/tmp/gradio/f5fd5dce8ca182c6d5fcc64c684e99e658ef7b6d9699f36594a1c64faab5ee7c/image.png", "size": 8195, "orig_name": "image.png", "mime_type": null, "is_stream": false, "meta": {"_type": "gradio.FileData"}}]

Screenshot

says spa and not space

image

Logs

No response

System Info

curl --version
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.13
Release-Date: 2022-01-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd

Severity

I can work around it

@not-lain not-lain added the bug Something isn't working label Sep 11, 2024
@freddyaboulton freddyaboulton added the gradio_client Related to the one of the gradio client libraries label Sep 13, 2024
@freddyaboulton
Copy link
Collaborator

What the heck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gradio_client Related to the one of the gradio client libraries
2 participants