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

Merge pull request #350 from a1noack/fix_query_count

fix model query count for all search methods
This commit is contained in:
Jin Yong Yoo
2020-11-22 00:29:45 -05:00
committed by GitHub
4 changed files with 23 additions and 18 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 = (