Cannot POST /spaces/[myusername]/test/predict
I am very new at this so my terminology might not be up to par. Please, bare with meI have setup a space with GradioI am also running Gradio locally:The UI’s seem to worknicely.I want to access Gradio via the API.Locally this works fine:curl -X POST http://127.0.0.1:7860/api/predict \
     -H "Content-Type: application/json" \
     -d '{"data": ["A sunset over a mountain", "", 0, true, 512, 512, 7.5, 5]}'But when I try to call the API on the Hugging Space like this:curl -X POST https://huggingface.co/spaces/[myusername]/[spacename]/api/predict \
     -H "Authorization: Bearer [my-hf-token]" \
     -H "Content-Type: application/json" \
     -d '{"data": ["A sunset over a mountain", "", 0, true, 512, 512, 7.5, 25]}'The following is returned:<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /spaces/[myusername]/[spacename]/run</pre>
</body>
</html>I tried all kinds of changes to the app.py file but nothing seems to work.Any tips?
2024-09-22T20:39:58Z
Try this.FastAPI Routing Issue in Hugging Face SpacesSpacesHello everyone, 
I’ve deployed a FastAPI application on Hugging Face Spaces. Everything seems to be running smoothly, and there are no errors in the logs. However, when I try to access my endpoints via a browser or tools like Postman, I’m getting a “404 error” or a “Cannot POST” error. 
Here’s a brief overview of my setup: 

I have a FastAPI route defined as @app.get("/check_request") and another one as @app.post("/recommend").
My Dockerfile specifies the CMD as CMD ["uvicorn", "app:app", "--hos…