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

Unable to get image out of gradio stream when calliing via curl API #10202

Open
1 task done
Himasnhu-AT opened this issue Dec 15, 2024 · 2 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@Himasnhu-AT
Copy link

Describe the bug

I ran the model using curl, got image address from stream. when i try to access image, i get output
{"detail":"Not Found"}

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

execute:

curl -X POST https://franciszzj-leffa.hf.space/call/leffa_predict_vt -s -H "Content-Type: application/json" -d '{
  "data": [
    {"path":"https://huggingface.co/spaces/franciszzj/Leffa/resolve/main/examples/14684_00_person.jpg"},
    {"path":"https://huggingface.co/spaces/franciszzj/Leffa/resolve/main/examples/04181_00_garment.jpg"}
]}' \
  | awk -F'"' '{ print $4}'  \
  | read EVENT_ID; curl -N https://franciszzj-leffa.hf.space/call/leffa_predict_vt/$EVENT_ID

open the image path in browser

Screenshot

No response

Logs

curl -X POST https://franciszzj-leffa.hf.space/call/leffa_predict_vt -s -H "Content-Type: application/json" -d '{
  "data": [
    {"path":"https://huggingface.co/spaces/franciszzj/Leffa/resolve/main/examples/14684_00_person.jpg"},
    {"path":"https://huggingface.co/spaces/franciszzj/Leffa/resolve/main/examples/04181_00_garment.jpg"}
]}' \
  | awk -F'"' '{ print $4}'  \
  | read EVENT_ID; curl -N https://franciszzj-leffa.hf.space/call/leffa_predict_vt/$EVENT_ID
event: heartbeat
data: null

event: heartbeat
data: null

event: heartbeat
data: null

event: heartbeat
data: null

event: heartbeat
data: null

event: heartbeat
data: null

event: heartbeat
data: null

event: complete
data: [{"path": "/tmp/gradio/a3f60fae71ec58a8968da3c8153d886d23d831b6/image.webp", "url": "https://franciszzj-leffa.hf.space/call/leffa/file=/tmp/gradio/a3f60fae71ec58a8968da3c8153d886d23d831b6/image.webp", "size": null, "orig_name": "image.webp", "mime_type": null, "is_stream": false, "meta": {"_type": "gradio.FileData"}}]

System Info

Local system: mac m1

curl config:

curl 8.7.1 (x86_64-apple-darwin23.0) libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.61.0
Release-Date: 2024-03-27
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM SPNEGO SSL threadsafe UnixSockets


gradio:
huggingface

Severity

Blocking usage of gradio

@Himasnhu-AT Himasnhu-AT added the bug Something isn't working label Dec 15, 2024
@abidlabs abidlabs changed the title Unable to get image out of gradio stream Unable to get image out of gradio stream when calliing via curl API Dec 16, 2024
@freddyaboulton
Copy link
Collaborator

Yea the URL is wrong - should be https://franciszzj-leffa.hf.space/gradio_api/file=<path>

@Himasnhu-AT
Copy link
Author

@freddyaboulton thankyou for reply. also, how can i call api to upload image to gradio client before making request for tryon. PS: i'll make request using curl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants