RkGrit commented on code in PR #16768:
URL: https://github.com/apache/iotdb/pull/16768#discussion_r2536969652


##########
iotdb-core/ainode/iotdb/ainode/core/model/timerxl/modeling_timer.py:
##########
@@ -606,7 +606,11 @@ def prepare_inputs_for_generation(
             if attention_mask is not None and attention_mask.shape[1] > (
                 input_ids.shape[1] // self.config.input_token_len
             ):
-                input_ids = input_ids[:, -(attention_mask.shape[1] - 
past_length) :]
+                input_ids = input_ids[
+                    :,
+                    -(attention_mask.shape[1] - past_length)
+                    * self.config.input_token_len :,
+                ]
             # 2 - If the past_length is smaller than input_ids', then 
input_ids holds all input tokens. We can discard
             # input_ids based on the past_length.
             elif past_length < (input_ids.shape[1] // 
self.config.input_token_len):

Review Comment:
   The same as above
   
   <img width="905" height="447" alt="image" 
src="https://github.com/user-attachments/assets/7238d3a7-7f9f-4d79-8c18-08370044a5fd";
 />
   



-- 
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]

Reply via email to