Skip to content

Commit

Permalink
Print traceback on model prediction exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
n8mellis committed Nov 17, 2023
1 parent ceca396 commit 2932bb0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/chassisml/src/chassis/runtime/model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import os
import json
import traceback

import cloudpickle
from typing import List, Mapping, Optional, Sequence, cast

Expand Down Expand Up @@ -106,6 +108,7 @@ def _predict_single(self, inputs: Sequence[Mapping[str, bytes]]) -> Sequence[Map
output: Mapping[str, bytes] = predict_fn(input_item)
except Exception as e:
print(f"Error: {e}")
traceback.print_exc()
# TODO - is there more information we can include here like a backtrace?
# TODO - convert the error to bytes
output = {"error": f"{e}".encode()}
Expand Down

0 comments on commit 2932bb0

Please sign in to comment.