Skip to content

Instantly share code, notes, and snippets.

@gaborvecsei
Created March 15, 2020 09:34
Show Gist options
  • Save gaborvecsei/d5836136a8b32391d9f490064f701643 to your computer and use it in GitHub Desktop.
Save gaborvecsei/d5836136a8b32391d9f490064f701643 to your computer and use it in GitHub Desktop.
model = load_model("/random_forest_model.pkl")
try:
sepal_length, sepal_width, petal_length, petal_width = parse_comment_input(args.issue_comment_body)
predicted_class_id = make_prediction(model, sepal_length, sepal_width, petal_length, petal_width)
predicted_class_name = map_class_id_to_name(predicted_class_id)
reply_message = f"Hey @{args.issue_user}!<br>This was your input: {args.issue_comment_body}.<br>The prediction: **{predicted_class_name}**"
except Exception as e:
reply_message = f"Hey @{args.issue_user}! There was a problem with your input. The error: {e}"
print(f"::set-output name=issue_comment_reply::{reply_message}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment