Skip to content

Commit

Permalink
Improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaniwaki authored and axsaucedo committed Aug 16, 2019
1 parent 2ea7fd0 commit 5d092cc
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions python/seldon_core/seldon_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ def predict(
try:
return user_model.predict_raw(request)
except (NotImplementedError, AttributeError):
if is_proto:
(features, meta, datadef, data_type) = extract_request_parts(request)
client_response = client_predict(user_model, features, datadef.names, meta=meta)
return construct_response(user_model, False, request, client_response)
else:
(features, meta, datadef, data_type) = extract_request_parts_json(request)
client_response = client_predict(user_model, features, datadef.names, meta=meta)
print(client_response)
return construct_response_json(user_model, False, request, client_response)
pass

if is_proto:
(features, meta, datadef, data_type) = extract_request_parts(request)
client_response = client_predict(user_model, features, datadef.names, meta=meta)
return construct_response(user_model, False, request, client_response)
else:
(features, meta, datadef, data_type) = extract_request_parts_json(request)
client_response = client_predict(user_model, features, datadef.names, meta=meta)
print(client_response)
return construct_response_json(user_model, False, request, client_response)


def send_feedback(user_model: Any, request: prediction_pb2.Feedback,
Expand Down

0 comments on commit 5d092cc

Please sign in to comment.