From 4f1de8148049bcb41a1ed22ffb591a13f15bb75c Mon Sep 17 00:00:00 2001 From: Jesper Dramsch Date: Fri, 6 Sep 2024 16:05:57 +0200 Subject: [PATCH] Revert "feat: make model instantiateable (#29)" (#31) This reverts commit 5c75822932ef688fc3c823166f028931da79d5c1. --- CHANGELOG.md | 1 - src/anemoi/models/interface/__init__.py | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9737b8..73713be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,6 @@ Keep it human-readable, your future self will thank you! - Update CI to inherit from common infrastructue reusable workflows - run downstream-ci only when src and tests folders have changed - New error messages for wrongs graphs. - - Feature: Change model to be instantiatable in the interface, addressing [#28](https://github.com/ecmwf/anemoi-models/issues/28) through [#29](https://github.com/ecmwf/anemoi-models/pulls/29) ### Removed diff --git a/src/anemoi/models/interface/__init__.py b/src/anemoi/models/interface/__init__.py index 546003a..54c548d 100644 --- a/src/anemoi/models/interface/__init__.py +++ b/src/anemoi/models/interface/__init__.py @@ -14,6 +14,7 @@ from hydra.utils import instantiate from torch_geometric.data import HeteroData +from anemoi.models.models.encoder_processor_decoder import AnemoiModelEncProcDec from anemoi.models.preprocessing import Processors @@ -72,9 +73,9 @@ def _build_model(self) -> None: self.pre_processors = Processors(processors) self.post_processors = Processors(processors, inverse=True) - # Instantiate the model - self.model = instantiate( - self.config.model.model, config=self.config, data_indices=self.data_indices, graph_data=self.graph_data + # Instantiate the model (Can be generalised to other models in the future, here we use AnemoiModelEncProcDec) + self.model = AnemoiModelEncProcDec( + config=self.config, data_indices=self.data_indices, graph_data=self.graph_data ) # Use the forward method of the model directly