finegrain-ai / refiners

A microframework on top of PyTorch with first-class citizen APIs for foundation model adaptation
https://refine.rs
MIT License
696 stars 53 forks source link

Internal server error on object cutter inference API #459

Closed kram254 closed 1 week ago

kram254 commented 1 week ago

I have been trying to use your refiners object cutter model on an App just for testing and I have not been able to get a response from the API endpoint, I keep getting internal server error image

Laurent2916 commented 1 week ago

Hi @kram254! There is no /predict endpoint on the space's API. The endpoints you should be hitting are process_bbox or process_prompt, you can see their documentation by clicking the "Use via API" at the bottom of the space.

Quick example:

from gradio_client import Client, handle_file

client = Client("finegrain/finegrain-object-cutter")
result = client.predict(
    img=handle_file('https://huggingface.co/spaces/finegrain/finegrain-object-cutter/resolve/main/examples/potted-plant.jpg'),
    prompt="teacup",
    api_name="/process_prompt"
)
print(result)