Skip to content

Commit bb0c619

Browse files
committed
Print inference error message in log
1 parent 76cb412 commit bb0c619

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/together/commands/inference.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,13 @@ def _run_complete(args: argparse.Namespace) -> None:
173173
# TODO Add exception when generated_text has error, See together docs
174174
try:
175175
text = str(response["output"]["choices"][0]["text"])
176-
except Exception as e:
177-
logger.critical(f"Error raised: {e}")
178-
exit_1(logger)
176+
except Exception:
177+
try:
178+
logger.critical(f"Error raised: {response['output']['error']}")
179+
exit_1(logger)
180+
except Exception as e:
181+
logger.critical(f"Error raised: {e}")
182+
exit_1(logger)
179183

180184
if args.stop is not None:
181185
# TODO remove this and permanently implement api stop_word

0 commit comments

Comments
 (0)