Skip to content

Commit

Permalink
format .
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrunel committed Aug 28, 2024
1 parent 4483cc9 commit 16bc42f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lavague-core/lavague/core/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def load_website_in_driver(driver, html, viewport_size, action):
driver.get(f"file:{f.name}")
driver.wait_for_idle()
element = driver.resolve_xpath(action["args"]["xpath"])
driver.execute_script("arguments[0].scrollIntoView({block: 'center', behavior: 'instant'});", element)
driver.execute_script(
"arguments[0].scrollIntoView({block: 'center', behavior: 'instant'});", element
)


FAIL_ACTION = {"args": {"xpath": "(string)"}, "name": "fail"}
Expand All @@ -99,7 +101,7 @@ def evaluate(
dataset: pd.DataFrame,
driver: SeleniumDriver = None, # Optional, the driver passed to the retriever
retriever_name: str = "",
wait_for_scroll: int = 1
wait_for_scroll: int = 1,
) -> pd.DataFrame:
result_filename = (
(retriever_name if retriever_name else type(retriever).__name__)
Expand All @@ -120,7 +122,7 @@ def evaluate(
action = yaml.safe_load(row["action"])
instruction = row["instruction"]
try:
if driver:
if driver:
driver.__init__()
viewport_size = parse_viewport_size(row["viewport_size"])
load_website_in_driver(
Expand Down

0 comments on commit 16bc42f

Please sign in to comment.