From c7cd6b49bb2d7dd4ae7f64bf754da9acf204f17c Mon Sep 17 00:00:00 2001 From: isaacmg Date: Fri, 28 Jun 2024 14:57:48 -0400 Subject: [PATCH] adding code --- .idea/misc.xml | 3 +++ flood_forecast/deployment/inference.py | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 8013cdf3b..2552b5735 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,7 @@ + + \ No newline at end of file diff --git a/flood_forecast/deployment/inference.py b/flood_forecast/deployment/inference.py index 79347e558..dc7a2ccc3 100644 --- a/flood_forecast/deployment/inference.py +++ b/flood_forecast/deployment/inference.py @@ -58,7 +58,7 @@ def infer_now(self, some_date: datetime, csv_path=None, save_buck=None, save_nam :param save_buck: The GCP bucket where you want to save predictions, defaults to None :type save_buck: str, optional :param save_name: The name of the file to save the Pandas data-frame to GCP as, defaults to None - :type save_name: str, optional + :type save_name: str, Optional :param use_torch_script: Optional parameter which allows you to use a saved torch script version of your model. :return: Returns a tuple consisting of the Pandas dataframe with predictions + history, the prediction tensor, a tensor of the historical values, the forecast start index, the test loader, and the @@ -71,8 +71,6 @@ def infer_now(self, some_date: datetime, csv_path=None, save_buck=None, save_nam self.inference_params["test_csv_path"] = csv_path self.inference_params["dataset_params"]["file_path"] = csv_path df, tensor, history, forecast_start, test, samples = infer_on_torch_model(self.model, **self.inference_params) - print("the tensor shape is 2 ") - print(tensor.shape) if test.scale and self.n_targets: unscaled = test.inverse_scale(tensor.numpy()) for i in range(0, self.n_targets):