Improve on eval script on web browsing tasks; Add one setup example
This commit is contained in:
@@ -316,6 +316,9 @@ class DesktopEnv(gym.Env):
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
else:
|
||||
if len(self.action_history) > 0 and self.action_history[-1] == "FAIL":
|
||||
return 0
|
||||
|
||||
if type(self.metric) == list:
|
||||
results = []
|
||||
|
||||
@@ -17,7 +17,7 @@ def is_expected_active_tab(active_tab_info: Dict[str, str], rule: Dict[str, Any]
|
||||
|
||||
if match_type == "url":
|
||||
expected_url = rule['url']
|
||||
actual_url = active_tab_info['url']
|
||||
actual_url = active_tab_info.get('url', None)
|
||||
print("expected_url: {}".format(expected_url))
|
||||
print("actual_url: {}".format(actual_url))
|
||||
return 1 if compare_urls(expected_url, actual_url) else 0
|
||||
|
||||
@@ -625,6 +625,9 @@ def are_lists_equal(list1, list2, comparison_func):
|
||||
|
||||
|
||||
def compare_urls(url1, url2):
|
||||
if url1 is None or url2 is None:
|
||||
return url1 == url2
|
||||
|
||||
def normalize_url(url):
|
||||
# Parse the URL
|
||||
parsed_url = urlparse(url)
|
||||
|
||||
Reference in New Issue
Block a user