ycycse commented on code in PR #15655:
URL: https://github.com/apache/iotdb/pull/15655#discussion_r2131482360
##########
iotdb-core/ainode/ainode/core/manager/inference_manager.py:
##########
@@ -57,7 +57,8 @@ def infer(self, full_data, predict_length=96, **_):
data = full_data[1][0]
if data.dtype.byteorder not in ("=", "|"):
data = data.byteswap().newbyteorder()
- output = self.model.inference(data, int(predict_length))
+ seqs = torch.tensor(data).unsqueeze(0).float()
+ output = self.model.generate(seqs, max_new_tokens=predict_length)
Review Comment:
Shouldn't we set the `revin=True`?
##########
iotdb-core/ainode/ainode/core/model/timerxl/modeling_timer.py:
##########
@@ -0,0 +1,681 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+import os
+from typing import List, Optional, Tuple, Union
+
+import torch
+import torch.nn.functional as F
+from huggingface_hub import hf_hub_download
+from safetensors.torch import load_file as load_safetensors
+from torch import nn
+from transformers import Cache, DynamicCache, PreTrainedModel
+from transformers.activations import ACT2FN
+from transformers.modeling_attn_mask_utils import
_prepare_4d_causal_attention_mask
+from transformers.modeling_outputs import (
+ MoeCausalLMOutputWithPast,
+ MoeModelOutputWithPast,
+)
+
+from ainode.core.log import Logger
+
+from .configuration_timer import TimerConfig
+from .ts_generation_mixin import TSGenerationMixin
Review Comment:
use absoluate import
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]