mirror of
https://github.com/QData/TextAttack.git
synced 2021-10-13 00:05:06 +03:00
make requested fixes
This commit is contained in:
@@ -28,7 +28,7 @@ class LanguageModelConstraint(Constraint):
|
||||
try:
|
||||
indices = x_adv.attack_attrs['newly_modified_indices']
|
||||
except KeyError:
|
||||
raise KeyError('Cannot apply part-of-speech constraint without `newly_modified_indices`')
|
||||
raise KeyError('Cannot apply language model constraint without `newly_modified_indices`')
|
||||
|
||||
for i in indices:
|
||||
probs = self.get_log_probs_at_index((x, x_adv), i)
|
||||
|
||||
Reference in New Issue
Block a user