Skip to content

Commit

Permalink
chore: move folder creation
Browse files Browse the repository at this point in the history
  • Loading branch information
JoFrost committed May 21, 2024
1 parent 6cfca70 commit c70ce5c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lavague-core/lavague/core/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ def run(self, objective, display=True, log: bool = False):

log_lines = []

if log:
if os.path.isdir("./logs") == False:
os.mkdir("./logs")
driver: WebDriver = self.driver.get_driver()
action_engine: ActionEngine = self.action_engine
world_model: WorldModel = self.world_model
Expand Down Expand Up @@ -160,7 +157,9 @@ def run(self, objective, display=True, log: bool = False):

if log:
import csv


if os.path.isdir("./logs") == False:
os.mkdir("./logs")
with open(f"./logs/{run_id}.csv", "w", newline="") as output_file:
keys = log_lines[0].keys()
dict_writer = csv.DictWriter(output_file, keys)
Expand Down

0 comments on commit c70ce5c

Please sign in to comment.