From d4192d3d9c24032c2d673732ce47ac28ff994761 Mon Sep 17 00:00:00 2001 From: David Chang Date: Sat, 13 Jan 2024 00:06:11 +0800 Subject: [PATCH] ver Jan12thv3 debugged --- desktop_env/evaluators/metrics/general.py | 6 +++--- main.py | 4 ++-- requirements.txt | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/desktop_env/evaluators/metrics/general.py b/desktop_env/evaluators/metrics/general.py index e1e2c95..5b5492e 100644 --- a/desktop_env/evaluators/metrics/general.py +++ b/desktop_env/evaluators/metrics/general.py @@ -150,6 +150,6 @@ def check_accessibility_tree(result: str, rules: Dict[str, Any]) -> float: # return 1. - (result is None) def run_sqlite3(result: str, rules: Dict[str, Any]) -> float: - connection = sqlite3.connect(result) - connection.execute(rules["sql"]) - return float(connection.fetchone()[0] or 0) + connection: sqlite3.Connection = sqlite3.connect(result) + cursor: sqlite3.Cursor = connection.execute(rules["sql"]) + return float(cursor.fetchone()[0] or 0) diff --git a/main.py b/main.py index 5da8091..6f5650a 100644 --- a/main.py +++ b/main.py @@ -44,9 +44,9 @@ def human_agent(): Runs the Gym environment with human input. """ - with open("evaluation_examples/examples/thunderbird/e1e75309-3ddb-4d09-92ec-de869c928143.json.nosetup", "r") as f: + with open("evaluation_examples/examples/thunderbird/3d1682a7-0fb0-49ae-a4dc-a73afd2d06d5.json.nosetup", "r") as f: example = json.load(f) - example["snapshot"] = "Snapshot 18" + example["snapshot"] = "Snapshot 20" env = DesktopEnv( path_to_vm="../../../../大文件/镜像/Ubuntu-1218/Ubuntu/Ubuntu.vmx" , action_space="computer_13" diff --git a/requirements.txt b/requirements.txt index 558098b..588ec1e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,3 +28,4 @@ pyacoustid opencv-python ImageHash scikit-image +librosa