Skip to content

Commit

Permalink
The previous change didn't fully suppress harmless mistral exceptions…
Browse files Browse the repository at this point in the history
…, this one fixes it.

PiperOrigin-RevId: 672837691
Change-Id: Ie232ceb2ab69961cc6e978fa32a4862961c7cd87
  • Loading branch information
jzleibo authored and copybara-github committed Sep 10, 2024
1 parent f2d9447 commit f4d0804
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions concordia/language_model/mistral_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f4d0804

Please sign in to comment.