Skip to content

Commit cfb8155

Browse files
gustavocidornelaswhoseoyster
authored andcommitted
Fix exception reporting logic for the LLM runners
1 parent 4a01e5c commit cfb8155

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

openlayer/model_runners/ll_model_runners.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,16 @@ def _get_cost_estimate(self, response: Dict[str, Any]) -> float:
235235
pass
236236

237237
def _report_exceptions(self, exceptions: set) -> None:
238-
if exceptions:
239-
warnings.warn(
240-
f"We couldn't get the outputs for all rows.\n"
241-
"Encountered the following exceptions while running the model: \n"
242-
f"{exceptions}\n"
243-
"After you fix the issues, you can call the `run` method again and provide "
244-
"the `output_column_name` argument to avoid re-running the model on rows "
245-
"that already have an output value."
246-
)
238+
if len(exceptions) == 1 and None in exceptions:
239+
return
240+
warnings.warn(
241+
f"We couldn't get the outputs for all rows.\n"
242+
"Encountered the following exceptions while running the model: \n"
243+
f"{exceptions}\n"
244+
"After you fix the issues, you can call the `run` method again and provide "
245+
"the `output_column_name` argument to avoid re-running the model on rows "
246+
"that already have an output value."
247+
)
247248

248249
def _run_in_conda(
249250
self, input_data: pd.DataFrame, output_column_name: Optional[str] = None

0 commit comments

Comments
 (0)