clipper
clipper copied to clipboard
what(): Number of model outputs: 1 does not equal the number of inputs: 2
Can someone give me an example of how an R function with string input and output would look like. I have tried:
pred_fn = function(str) {
return("value")
}
and then tested like:
curl -X POST --header "Content-Type:application/json" -d '{"input": "value"}' 127.0.0.1:1337/app1/predict
It didn't work and I see this error:
what(): Number of model outputs: 1 does not equal the number of inputs: 2
But I see both of these are strings of same length.
Even though I am passing and then returning same variable. I am getting the following error.
Number of model outputs: 1 does not equal the number of inputs: 2
my prediction function is as following:
pred_fn = function(str) {
phenologyForecast(siteName="HarvardForest",URL="http://phenocam.sr.unh.edu/data/archive/harvard/ROI/harvard_DB_0001_1day.csv",forecastLength = 30)
return(str)
}
We use adaptive batching to figure out the optimal batch size for a model. So the input to your function should be a list of str instead of just a single string; it should return a list of string as well.
See https://github.com/ucbrise/clipper/issues/513 for more info.