diff --git a/apps/worker/worker.py b/apps/worker/worker.py index ecbe445..00a435e 100644 --- a/apps/worker/worker.py +++ b/apps/worker/worker.py @@ -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 for artifact in ["pipeline_meta.pkl", "Temporal_FCN.pth", "calibrated_hybrid_cb.pkl"]: try: - storage.download_model_file(artifact, model_dir) + storage.download_file(storage.bucket_models, artifact, model_dir / artifact) print(f"[{job_id}] Downloaded {artifact}") except Exception as e: print(f"[{job_id}] Failed to download {artifact}: {e}") # Try with 'hybrid/' prefix if direct fails 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)") 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