tnk2908 commited on
Commit
162b7a6
1 Parent(s): 8afcedd

Avoid out of bound error

Browse files
Files changed (1) hide show
  1. processors.py +2 -0
processors.py CHANGED
@@ -184,6 +184,8 @@ class EncryptorLogitsProcessor(LogitsProcessor, BaseProcessor):
184
  byte_enc_msg[i] = byte_arr[(i - start) // values_per_byte]
185
 
186
  for i, b in enumerate(self.msg):
 
 
187
  base_msg[i + self.start_pos] = b
188
  byte_msg[i + self.start_pos] = self.raw_msg[i // values_per_byte]
189
 
 
184
  byte_enc_msg[i] = byte_arr[(i - start) // values_per_byte]
185
 
186
  for i, b in enumerate(self.msg):
187
+ if i + self.start_pos >= len(base_msg):
188
+ break
189
  base_msg[i + self.start_pos] = b
190
  byte_msg[i + self.start_pos] = self.raw_msg[i // values_per_byte]
191