Skip to content

Commit

Permalink
adding code
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacmg committed Jun 28, 2024
1 parent 6286c90 commit c7cd6b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions flood_forecast/deployment/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit c7cd6b4

Please sign in to comment.