fix(worker): correct artifact download logic for hybrid inference
Build and Push Docker Images / build-and-push (push) Has been cancelled
Details
Build and Push Docker Images / build-and-push (push) Has been cancelled
Details
This commit is contained in:
parent
5caabc930d
commit
d8b386c618
|
|
@ -388,16 +388,16 @@ def run_job(payload_dict: dict) -> dict:
|
||||||
# Expected files in MinIO: pipeline_meta.pkl, Temporal_FCN.pth, calibrated_hybrid_cb.pkl
|
# Expected files in MinIO: pipeline_meta.pkl, Temporal_FCN.pth, calibrated_hybrid_cb.pkl
|
||||||
for artifact in ["pipeline_meta.pkl", "Temporal_FCN.pth", "calibrated_hybrid_cb.pkl"]:
|
for artifact in ["pipeline_meta.pkl", "Temporal_FCN.pth", "calibrated_hybrid_cb.pkl"]:
|
||||||
try:
|
try:
|
||||||
storage.download_model_file(artifact, model_dir)
|
storage.download_file(storage.bucket_models, artifact, model_dir / artifact)
|
||||||
print(f"[{job_id}] Downloaded {artifact}")
|
print(f"[{job_id}] Downloaded {artifact}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[{job_id}] Failed to download {artifact}: {e}")
|
print(f"[{job_id}] Failed to download {artifact}: {e}")
|
||||||
# Try with 'hybrid/' prefix if direct fails
|
# Try with 'hybrid/' prefix if direct fails
|
||||||
try:
|
try:
|
||||||
storage.download_file("geocrop-models", f"hybrid/{artifact}", model_dir / artifact)
|
storage.download_file(storage.bucket_models, f"hybrid/{artifact}", model_dir / artifact)
|
||||||
print(f"[{job_id}] Downloaded {artifact} (from hybrid/ prefix)")
|
print(f"[{job_id}] Downloaded {artifact} (from hybrid/ prefix)")
|
||||||
except Exception as e2:
|
except Exception as e2:
|
||||||
raise FileNotFoundError(f"Required artifact {artifact} not found in geocrop-models: {e2}")
|
raise FileNotFoundError(f"Required artifact {artifact} not found in {storage.bucket_models}: {e2}")
|
||||||
|
|
||||||
# ==========================================
|
# ==========================================
|
||||||
# Stage 4: Fetch Spatio-Temporal Data
|
# Stage 4: Fetch Spatio-Temporal Data
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue