Skip to content

Commit

Permalink
update edge inference model repository field
Browse files Browse the repository at this point in the history
  • Loading branch information
blaise-muhirwa committed Jan 22, 2024
1 parent 120d46d commit 9b580a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/core/edge_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class EdgeInferenceManager:
INPUT_IMAGE_NAME = "image"
MODEL_OUTPUTS = ["score", "confidence", "probability", "label"]
INFERENCE_SERVER_URL = "inference-service:8000"
MODEL_REPOSITORY = MODEL_REPOSITORY_PATH

def __init__(self, config: Dict[str, LocalInferenceConfig] | None, verbose: bool = False) -> None:
"""
Expand Down Expand Up @@ -163,7 +164,7 @@ def update_model(self, detector_id: str) -> bool:
if cloud_binary_ksuid is None:
logger.warning(f"No model binary ksuid returned for {detector_id}")

model_dir = os.path.join(MODEL_REPOSITORY_PATH, detector_id)
model_dir = os.path.join(self.MODEL_REPOSITORY, detector_id)
edge_binary_ksuid = get_current_model_ksuid(model_dir)
if edge_binary_ksuid and cloud_binary_ksuid is not None and cloud_binary_ksuid <= edge_binary_ksuid:
logger.info(f"No new model available for {detector_id}")
Expand All @@ -179,7 +180,7 @@ def update_model(self, detector_id: str) -> bool:
model_buffer,
pipeline_config,
binary_ksuid=cloud_binary_ksuid,
repository_root=MODEL_REPOSITORY_PATH,
repository_root=self.MODEL_REPOSITORY,
)
return True

Expand Down
2 changes: 1 addition & 1 deletion deploy/bin/setup_db.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!/bin/bash
#!/bin/bash

# Sets up the SQLite database for the edge endpoint.
# Expects the following environment variables:
Expand Down

0 comments on commit 9b580a4

Please sign in to comment.