I've developed an ML Skill model (TPOTAutoMLClassification) using tabular data. I'm facing a deployment issue due to a JSON error. Could you please help me resolve it?

“{
“code”: “InternalServerError”,
“message”: “Trailing data”,
“stacktrace”: " File "/microservice/main.py", line 13, in predict\n return self.model.predict(mlskill_input)\n File "/microservice/aiflib/model.py", line 171, in predict\n data = pd.read_json(mlskill_input)\n File "./deps/pandas/util/_decorators.py", line 199, in wrapper\n return func(*args, **kwargs)\n File "./deps/pandas/util/_decorators.py", line 296, in wrapper\n return func(*args, **kwargs)\n File "./deps/pandas/io/json/_json.py", line 618, in read_json\n result = json_reader.read()\n File "./deps/pandas/io/json/_json.py", line 755, in read\n obj = self._get_object_parser(self.data)\n File "./deps/pandas/io/json/_json.py", line 777, in _get_object_parser\n obj = FrameParser(json, **kwargs).parse()\n File "./deps/pandas/io/json/_json.py", line 886, in parse\n self._parse_no_numpy()\n File "./deps/pandas/io/json/_json.py", line 1119, in _parse_no_numpy\n loads(json, precise_float=self.precise_float), dtype=None\nValueError: Trailing data”,
“trace_id”: null,
“reason”: null
}"

@mpathuri

What is the ml package used

And what data is passed? When you say json error when you are trying to consume instudio are you getting error?

Cheers

Thanks for the response Anil
ML Skill USed : TPOTAutoMLClassification
Data Passed : Tabular Data Here Given Below
And Input Json Format is : {{“Pregnancies”:6,“Glucose”:148,“BloodPressure”:72,“SkinThickness”:35,“Insulin”:0,“BMI”:33.6,“DiabetesPedigreeFunction”:0.627,“Age”:50,“Outcome”:1}}
And
{
“Pregnancies”:6,
“Glucose”:148,
“BloodPressure”:72,
“SkinThickness”:35,
“Insulin”:0,
“BMI”:33.6,
“DiabetesPedigreeFunction”:0.627,
“Age”:50
}

Pregnancies Glucose BloodPressure SkinThickness Insulin BMI DiabetesPedigreeFunction Age Outcome
6 148 72 35 0 33.6 0.627 50 1
1 85 66 29 0 26.6 0.351 31 0
8 183 64 0 0 23.3 0.672 32 1
1 89 66 23 94 28.1 0.167 21 0
0 137 40 35 168 43.1 2.288 33 1
5 116 74 0 0 25.6 0.201 30 0
3 78 50 32 88 31 0.248 26 1
10 115 0 0 0 35.3 0.134 29 0
2 197 70 45 543 30.5 0.158 53 1

Your JSON data doesn’t look right.
You have a double {{ on the first but not the second and we cannot see how you format the array. I’d validate your JSON is indeed valid.

@mpathuri

That is the skill you created…using which package did you create?

Also if you are sending full table then ideally it should be an array

If you are sendng individual rows then what @Jon_Smith mentioned makes sense

Cheers