Skip to content

Commit

Permalink
chore: ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
JoFrost committed May 21, 2024
1 parent 89bd0ae commit 6cfca70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lavague-core/lavague/core/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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")
print(f"Logs exported to logs/{run_id}.csv")
3 changes: 2 additions & 1 deletion lavague-core/lavague/core/utilities/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -137,4 +138,4 @@ def send_telemetry(
"success": str(success),
"error_msg": error,
}
return line
return line

0 comments on commit 6cfca70

Please sign in to comment.