diff --git a/concordia/language_model/mistral_model.py b/concordia/language_model/mistral_model.py index 35894110..4449a0ce 100644 --- a/concordia/language_model/mistral_model.py +++ b/concordia/language_model/mistral_model.py @@ -114,7 +114,8 @@ def _complete_text( random_seed=seed, ) except mistralai.models.sdkerror.SDKError as err: - print(f' Exception: {err}') + if attempts >= _NUM_SILENT_ATTEMPTS: + print(f' Exception: {err}') continue else: result = response.choices[0].message.content @@ -179,7 +180,8 @@ def _chat_text( random_seed=seed, ) except mistralai.models.sdkerror.SDKError as err: - print(f' Exception: {err}') + if attempts >= _NUM_SILENT_ATTEMPTS: + print(f' Exception: {err}') continue else: return response.choices[0].message.content