From 6cfca70371580afef425ceb91a617cabd561bb42 Mon Sep 17 00:00:00 2001 From: JoFrost Date: Tue, 21 May 2024 17:43:59 +0300 Subject: [PATCH] chore: ruff --- lavague-core/lavague/core/agents.py | 8 ++++---- lavague-core/lavague/core/utilities/telemetry.py | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lavague-core/lavague/core/agents.py b/lavague-core/lavague/core/agents.py index f6b9f1ac..928e1f76 100644 --- a/lavague-core/lavague/core/agents.py +++ b/lavague-core/lavague/core/agents.py @@ -143,7 +143,7 @@ def run(self, objective, display=True, log: bool = False): multi_modal_model=world_model.mm_llm.metadata.model_name, step_id=step_id, run_id=run_id, - log=log + log=log, ) send_telemetry_scr( action_id, @@ -157,13 +157,13 @@ def run(self, objective, display=True, log: bool = False): else: print("Objective reached") break - + if log: import csv - with open(f'./logs/{run_id}.csv', 'w', newline='') as output_file: + with open(f"./logs/{run_id}.csv", "w", newline="") as output_file: keys = log_lines[0].keys() dict_writer = csv.DictWriter(output_file, keys) dict_writer.writeheader() dict_writer.writerows(log_lines) - print(f"Logs exported to logs/{run_id}.csv") \ No newline at end of file + print(f"Logs exported to logs/{run_id}.csv") diff --git a/lavague-core/lavague/core/utilities/telemetry.py b/lavague-core/lavague/core/utilities/telemetry.py index 0b759688..213a2acf 100644 --- a/lavague-core/lavague/core/utilities/telemetry.py +++ b/lavague-core/lavague/core/utilities/telemetry.py @@ -15,6 +15,7 @@ if UNIQUE_ID is not None: UNIQUE_ID = UNIQUE_ID[:256] + def compress_img(img: Image): buffer: BytesIO = BytesIO() img_ret = img.resize((1024, 1024), Image.LANCZOS) @@ -137,4 +138,4 @@ def send_telemetry( "success": str(success), "error_msg": error, } - return line \ No newline at end of file + return line