From 8d5b8eb2ce21f23b5983f8f572f916c648348608 Mon Sep 17 00:00:00 2001 From: RiteshKSingh1709 Date: Wed, 12 Feb 2020 16:22:34 +0530 Subject: [PATCH] float32 serializable issue --- api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api.py b/api.py index f783b24..4bbf73c 100644 --- a/api.py +++ b/api.py @@ -13,6 +13,9 @@ def predict(): text = request.json["text"] try: out = model.predict(text) + # Float32 is not json serializable #13 + for item in out: + item['confidence'] = str(item['confidence']) return jsonify({"result":out}) except Exception as e: print(e)