Skip to content

Commit

Permalink
Fail the job if no backends are online
Browse files Browse the repository at this point in the history
  • Loading branch information
vanessavmac committed Dec 19, 2024
1 parent 6813219 commit 8f72fd3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ami/ml/models/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,10 @@ def choose_backend_for_pipeline(self, job_id):
return backend_id_lowest_latency

def process_images(self, images: typing.Iterable[SourceImage], job_id: int | None = None):
backend_id = self.choose_backend_for_pipeline(job_id)
if not isinstance(backend_id, int):
return backend_id
try:
backend_id = self.choose_backend_for_pipeline(job_id)
except Exception:
return

if not self.backends.filter(pk=backend_id).first().endpoint_url:
raise ValueError("No endpoint URL configured for this pipeline")
Expand Down

0 comments on commit 8f72fd3

Please sign in to comment.