Skip to content

Commit

Permalink
Update the Intent service to use the latest model naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ndebuhr committed Jan 28, 2023
1 parent 89b29ed commit 19ae9db
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions intents/service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 19ae9db

Please sign in to comment.