I don't like the way you nadle the range.
- User
I don't like the way you nadle the range.
Assistant
You're right, my range handling wasn't ideal. Let me improve it with a clearer implementation:
import numpy as np # Load the two numpy arrays sliding_scores_10_pos = np.load('sliding_scores-10-pos.npy') sliding_scores_35_pos = np.load('sliding_scores-35-pos.npy') # Create an output array to store the results sliding_scores_1035max_pos = np.copy(sliding_scores_10_pos) # Iterate through the 10-pos array for i in range(len(sliding_scores_10_pos)): # Calculate the search range in 35-pos array (between x-27 and x-21) start_idx = max(0, i - 27) end_idx = min(len(sliding_scores_35_pos), i - 21 + 1) # +1 for inclusive end # Only process if we have a valid range if start_idx < end_idx: # Find max value in the range and add to 10-pos max_value = np.max(sliding_scores_35_pos[start_idx:end_idx]) sliding_scores_1035max_pos[i] += max_value # If no valid range exists, we keep the original 10-pos value # Save the new array np.save('sliding_scores-1035max-pos.npy', sliding_scores_1035max_pos)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.