Skip to content

Commit

Permalink
feat: add ml health check endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Vince Loewe <vince@lunary.ai>
  • Loading branch information
hughcrt authored and vincelwt committed Mar 31, 2024
1 parent be030c7 commit 00da4f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/ml/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
cli = sys.modules['flask.cli']
cli.show_server_banner = lambda *x: None

@app.route('/health', methods=['GET'])
def health_check():
return jsonify({"status": "healthy"}), 200

@app.route('/lang', methods=['POST'])
def language_route():
text = request.json['text']
Expand All @@ -22,6 +26,7 @@ def toxicity_route():
results = detect_toxicity(texts)
return jsonify(results)

# TODO: index errors
@app.route('/pii', methods=['POST'])
def pii_route():
model_id = request.json.get('bert_model', None)
Expand Down

0 comments on commit 00da4f3

Please sign in to comment.