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

yongzao pushed a commit to branch fix-inference-seed
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/fix-inference-seed by this 
push:
     new a1c11602808 Update inference_manager.py
a1c11602808 is described below

commit a1c116028088c53c3eba4241fea8f2456c56f40f
Author: Yongzao <[email protected]>
AuthorDate: Tue Jul 1 21:33:30 2025 +0800

    Update inference_manager.py
---
 iotdb-core/ainode/ainode/core/manager/inference_manager.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/iotdb-core/ainode/ainode/core/manager/inference_manager.py 
b/iotdb-core/ainode/ainode/core/manager/inference_manager.py
index d685970758a..ae55725eaf4 100644
--- a/iotdb-core/ainode/ainode/core/manager/inference_manager.py
+++ b/iotdb-core/ainode/ainode/core/manager/inference_manager.py
@@ -15,8 +15,10 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+import random
 from abc import ABC, abstractmethod
 
+import numpy as np
 import pandas as pd
 import torch
 from iotdb.tsfile.utils.tsblock_serde import deserialize
@@ -41,6 +43,7 @@ from ainode.thrift.ainode.ttypes import (
 )
 
 logger = Logger()
+FIX_SEED = 2021
 
 
 class InferenceStrategy(ABC):
@@ -143,6 +146,9 @@ class InferenceManager:
     ):
         model_id = req.modelId
         logger.info(f"Start processing for {model_id}")
+        random.seed(FIX_SEED)
+        torch.manual_seed(FIX_SEED)
+        np.random.seed(FIX_SEED)
         try:
             raw = data_getter(req)
             full_data = deserializer(raw)

Reply via email to