You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "RkGrit (via GitHub)" <gi...@apache.org> on 2025/12/15 15:00:09 UTC
[PR] Modify pipeline and automap [iotdb]
RkGrit opened a new pull request, #16907:
URL: https://github.com/apache/iotdb/pull/16907
Two modifications regarding model management, including:
- Expose the preprocess and postprocess interfaces of the Pipeline class.
- Delete config_cls and model_cls in ModelInfo, only maintain auto_map for hf transformers model.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Modify pipeline and automap [iotdb]
Posted by "CRZbulabula (via GitHub)" <gi...@apache.org>.
CRZbulabula commented on code in PR #16907:
URL: https://github.com/apache/iotdb/pull/16907#discussion_r2622626382
##########
iotdb-core/ainode/iotdb/ainode/core/inference/pipeline/basic_pipeline.py:
##########
@@ -29,59 +29,61 @@ def __init__(self, model_info, **model_kwargs):
self.device = model_kwargs.get("device", "cpu")
self.model = load_model(model_info, device_map=self.device, **model_kwargs)
- def _preprocess(self, inputs):
+ @abstractmethod
+ def preprocess(self, inputs):
"""
Preprocess the input before inference, including shape validation and value transformation.
"""
- return inputs
+ raise NotImplementedError("preprocess not implemented")
- def _postprocess(self, output: torch.Tensor):
+ @abstractmethod
+ def postprocess(self, output: torch.Tensor):
"""
Post-process the outputs after the entire inference task.
"""
- return output
+ raise NotImplementedError("postprocess not implemented")
class ForecastPipeline(BasicPipeline):
def __init__(self, model_info, **model_kwargs):
super().__init__(model_info, model_kwargs=model_kwargs)
- def _preprocess(self, inputs):
+ def preprocess(self, inputs):
return inputs
@abstractmethod
def forecast(self, inputs, **infer_kwargs):
pass
- def _postprocess(self, output: torch.Tensor):
+ def postprocess(self, output: torch.Tensor):
Review Comment:
And the shape of `inputs` should be 3-d.
##########
iotdb-core/ainode/iotdb/ainode/core/inference/pipeline/basic_pipeline.py:
##########
@@ -29,59 +29,61 @@ def __init__(self, model_info, **model_kwargs):
self.device = model_kwargs.get("device", "cpu")
self.model = load_model(model_info, device_map=self.device, **model_kwargs)
- def _preprocess(self, inputs):
+ @abstractmethod
+ def preprocess(self, inputs):
"""
Preprocess the input before inference, including shape validation and value transformation.
"""
- return inputs
+ raise NotImplementedError("preprocess not implemented")
- def _postprocess(self, output: torch.Tensor):
+ @abstractmethod
+ def postprocess(self, output: torch.Tensor):
"""
Post-process the outputs after the entire inference task.
"""
- return output
+ raise NotImplementedError("postprocess not implemented")
class ForecastPipeline(BasicPipeline):
def __init__(self, model_info, **model_kwargs):
super().__init__(model_info, model_kwargs=model_kwargs)
- def _preprocess(self, inputs):
+ def preprocess(self, inputs):
return inputs
@abstractmethod
def forecast(self, inputs, **infer_kwargs):
pass
- def _postprocess(self, output: torch.Tensor):
+ def postprocess(self, output: torch.Tensor):
Review Comment:
U should add some annotations to notify the shape of `inputs` and `output` for forecasting task.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Modify pipeline and automap [iotdb]
Posted by "CRZbulabula (via GitHub)" <gi...@apache.org>.
CRZbulabula closed pull request #16907: Modify pipeline and automap
URL: https://github.com/apache/iotdb/pull/16907
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Modify pipeline and automap [iotdb]
Posted by "yunbow30944 (via GitHub)" <gi...@apache.org>.
yunbow30944 commented on PR #16907:
URL: https://github.com/apache/iotdb/pull/16907#issuecomment-3658962921
LGTM!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org