This is an automated email from the ASF dual-hosted git repository.

yongzao pushed a commit to branch retrieve-ckpt-path-
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/retrieve-ckpt-path- by this 
push:
     new acf91d9089b finish
acf91d9089b is described below

commit acf91d9089b88a71854fc61e7b4bed50ed72ef4b
Author: Yongzao <[email protected]>
AuthorDate: Tue Jun 10 13:34:19 2025 +0800

    finish
---
 iotdb-core/ainode/ainode/core/manager/model_manager.py | 14 +++++++++++++-
 iotdb-core/ainode/ainode/core/model/model_storage.py   | 12 ++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/iotdb-core/ainode/ainode/core/manager/model_manager.py 
b/iotdb-core/ainode/ainode/core/manager/model_manager.py
index 95fdda1456b..85c339380e6 100644
--- a/iotdb-core/ainode/ainode/core/manager/model_manager.py
+++ b/iotdb-core/ainode/ainode/core/manager/model_manager.py
@@ -100,9 +100,21 @@ class ModelManager:
         logger.info(f"load model {model_id}")
         return self.model_storage.load_model(model_id, acceleration)
 
+    def get_ckpt_path(self, model_id: str) -> str:
+        """
+        Get the checkpoint path for a given model ID.
+
+        Args:
+            model_id (str): The ID of the model.
+
+        Returns:
+            str: The path to the checkpoint file for the model.
+        """
+        return self.model_storage.get_ckpt_path(model_id)
+
     @staticmethod
     def load_built_in_model(model_id: str, attributes: {}):
         model_id = model_id.lower()
         if model_id not in BuiltInModelType.values():
             raise BuiltInModelNotSupportError(model_id)
-        return fetch_built_in_model(model_id, attributes)
+        return fetch_built_in_model(model_id, attributes)
\ No newline at end of file
diff --git a/iotdb-core/ainode/ainode/core/model/model_storage.py 
b/iotdb-core/ainode/ainode/core/model/model_storage.py
index c0e2a21c80a..47b8d421311 100644
--- a/iotdb-core/ainode/ainode/core/model/model_storage.py
+++ b/iotdb-core/ainode/ainode/core/model/model_storage.py
@@ -119,3 +119,15 @@ class ModelStorage(object):
     def _remove_from_cache(self, file_path: str) -> None:
         if file_path in self._model_cache:
             del self._model_cache[file_path]
+
+    def get_ckpt_path(self, model_id: str) -> str:
+        """
+        Get the checkpoint path for a given model ID.
+
+        Args:
+            model_id (str): The ID of the model.
+
+        Returns:
+            str: The path to the checkpoint file for the model.
+        """
+        return os.path.join(self._model_dir, f"{model_id}")
\ No newline at end of file

Reply via email to