Hi, I understand the syntax curl -X POST -H 'Content-type: application/json' --data '{ "data": ["Jill"] }' https://USER_NAME-SPACE_NAME.hf.space/run/predict
and trying it out on a space with a simple text input e.g.,
curl -X POST -H 'Content-type: application/json' --data '{ "data": ["Jill"] }' https://tomsoderlund-rest-api-with-gradio.hf.space/run/predict
returns a nice
{"data":["Hello Jill!"],"is_generating":false,"duration":0.00015020370483398438,"average_duration":0.00018148869276046753}
But how do I post to a space with sliders, toggles, etc?
For instance, I tried https://huggingface.co/spaces/Svngoku/galactica-base
whose API suggest this Input Payload
{
"data": [
str | None, // represents sample input to preprocess. of 'Input Text' Textbox component
Any, // represents null of 'Max Length' Slider component
Any, // represents null of 'Temperature' Slider component
Any, // represents null of 'Do Sample' Checkbox component
]
}
does not work with
POST https://svngoku-galactica-base.hf.space/run/predict
Content-Type: application/json
{ "data": ["Test",128,0.7,True]}
and returns
{
"detail": [
{
"loc": [
"body",
32
],
"msg": "Expecting value: line 2 column 21 (char 32)",
"type": "value_error.jsondecode",
"ctx": {
"msg": "Expecting value",
"doc": "{ \"data\": [\n \t \"Test\",128,0.7,True]}",
"pos": 32,
"lineno": 2,
"colno": 21
}
}
]
}
I tried many variants, key/value pairs, adding parameters beside data, but none worked.
So, my question is how to aggregate data correctly for spaces with GUI elements when using /run/predict POST? Thanks.