1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00

fix query count for GoalFunctionResult returned by SearchMethod._perform_search

This commit is contained in:
Adam Noack
2020-11-20 22:20:11 -08:00
parent ede35d40ff
commit fe5aa5cf41
3 changed files with 6 additions and 3 deletions

View File

@@ -108,6 +108,8 @@ class Attack:
# Give search method access to functions for getting transformations and evaluating them
self.search_method.get_transformations = self.get_transformations
# Give search method access to self.goal_function for model query count, etc.
self.search_method.goal_function = self.goal_function
# The search method only needs access to the first argument. The second is only used
# by the attack class when checking whether to skip the sample
self.search_method.get_goal_results = (