Spaces:
Running on Zero
Running on Zero
A newer version of the Gradio SDK is available: 6.26.0
Hugging Face Space configuration
Create a Docker Space and upload the project files.
The Space should contain:
Dockerfile
requirements.txt
app/
model/
For a model stored on the Hugging Face Hub, you can instead omit the local model/ directory and set the Space variables:
MODEL_ID=YOUR_USERNAME/YOUR_MODEL_REPO
HF_TOKEN=hf_your_token_if_private
The API starts on port 7860.
Endpoints:
GET /healthPOST /predictGET /docs
Example:
curl -X POST \
-F "file=@freezer.jpg" \
"https://YOUR-SPACE-NAME.hf.space/predict?return_image=true"
The annotated_image_base64 field contains the annotated result image.