Subject: Issue with Gradio API Client – Deepseek-Janus-Pro-7B Hanging or Returning "Not Found"

#168
by AntonioRC991 - opened

Hello Hugging Face Team,

I am currently trying to interact with the deepseek-ai/Janus-Pro-7B model using the gradio_client library from a remote server. I have followed the recommended approach for API calls as outlined in the documentation but encountered some issues.

Issue 1: API Call Hanging
When initializing the client:

python
Copy
Edit
from gradio_client import Client

client = Client("deepseek-ai/Janus-Pro-7B", hf_token="hf_MY_TOKEN")
The response correctly indicates that the API is loaded:

csharp
Copy
Edit
Loaded as API: https://deepseek-ai-janus-pro-7b.hf.space
However, when I try to call an endpoint using:

python
Copy
Edit
result = client.predict(
"A futuristic city with flying cars",
1234,
5,
1,
api_name="/generate_image"
)
print(result)
The execution hangs indefinitely without any error or response.

Issue 2: API Calls Return "Not Found"
When attempting a direct curl request to the endpoint:

bash
Copy
Edit
curl -X POST "https://deepseek-ai-janus-pro-7b.hf.space/run/generate_image"
-H "Authorization: Bearer hf_MY_TOKEN"
-H "Content-Type: application/json"
-d '{
"data": [
"A futuristic city with flying cars",
1234,
5,
1
]
}'
The response is:

json
Copy
Edit
{"detail":"Not Found"}
Despite the fact that /generate_image is clearly listed as an API endpoint in the documentation.

Troubleshooting Steps Taken
Verified that the space is public and accessible via https://deepseek-ai-janus-pro-7b.hf.space/
Successfully loaded the client with gradio_client
Tried calling .view_api() but it does not return anything
Checked for any firewall or network restrictions
Attempted using fn_index instead of api_name, but it still does not work
Confirmed that gradio_client is correctly installed and up to date
Questions
Is there a known issue with calling this API using gradio_client?
Is /generate_image the correct API name, or should I be using fn_index?
Why does client.view_api() return nothing?
Are there additional configurations needed to call this endpoint remotely?
Any help or guidance would be greatly appreciated.

Best regards,
Antonio

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment