From 49c7c851a876791ef1d95b7ddf16e74617c612b6 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Fri, 10 Nov 2023 09:44:59 -0800 Subject: [PATCH] (feat) replicate exception mapping --- litellm/llms/replicate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/replicate.py b/litellm/llms/replicate.py index 238e1e7f87..e70a6d4944 100644 --- a/litellm/llms/replicate.py +++ b/litellm/llms/replicate.py @@ -129,7 +129,7 @@ def handle_prediction_response(prediction_url, api_token, print_verbose): logs = response_data.get("logs", "") if status == "failed": replicate_error = response_data.get("error", "") - raise ReplicateError(status_code=500, message=f"Error: {replicate_error}, \n Replicate logs{logs}") + raise ReplicateError(status_code=400, message=f"Error: {replicate_error}, \nReplicate logs:{logs}") else: # this can fail temporarily but it does not mean the replicate request failed, replicate request fails when status=="failed" print_verbose("Replicate: Failed to fetch prediction status and output.") @@ -241,7 +241,7 @@ def completion( if len(result) == 0: # edge case, where result from replicate is empty result = " " - + ## Building RESPONSE OBJECT if len(result) > 1: model_response["choices"][0]["message"]["content"] = result