diff --git a/intents/service/main.py b/intents/service/main.py index 7577928..20c2c4e 100644 --- a/intents/service/main.py +++ b/intents/service/main.py @@ -22,13 +22,12 @@ ]) classifier_model = tf.keras.models.load_model( - 'intents.keras', + 'model', custom_objects={'KerasLayer': hub.KerasLayer} ) @app.route("/v1/intents", methods=["POST"]) def repeat(): - print(request.get_json()) results = tf.nn.softmax(classifier_model(tf.constant(request.get_json()))) intents = binarizer.inverse_transform(results.numpy()) return json.dumps(list(intents))