EvalNames with dates for the eval run filename and compatibility with 0.3.0 (#26)

* EvalNames with dates and the eval run

* Ignore .idea files, update readme to use 3.10, updates for 0.3.0
pull/5155/head
Douglas Schonholtz 2023-05-03 10:14:44 -04:00 committed by GitHub
parent b8c7c05dd5
commit 04722e7fc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 8 deletions

2
.gitignore vendored
View File

@ -129,3 +129,5 @@ dmypy.json
.pyre/
/data
/.idea

View File

@ -18,7 +18,7 @@ Clone the repo with:
Create a venv with
python3.9 -m venv venv
python3.10 -m venv venv
On MaxOS/Linux Activate it with

View File

@ -80,15 +80,17 @@ class AutoGPTAgent:
envs = [
f"{line.strip()}" for line in open(
env_file
) if line.strip() != "" and line.strip()[0] != "#" and line.strip()[0] != "\n"]
) if line.strip() != "" and line.strip()[0] != "#" and line.strip()[0] != "\n" and "=" in line and not line.startswith('SMART_LLM_MODEL')]
envs.append("SMART_LLM_MODEL=gpt-3.5-turbo")
self.container = client.containers.run(
image="autogpt",
command="--continuous -C '/home/appuser/auto_gpt_workspace/ai_settings.yaml'",
command="--continuous -C '/app/auto_gpt_workspace/ai_settings.yaml' --skip-news",
environment=envs,
volumes={
self.auto_workspace: {"bind": "/home/appuser/auto_gpt_workspace", "mode": "rw"},
f"{self.auto_gpt_path}/autogpt": {"bind": "/home/appuser/autogpt", "mode": "rw"},
self.auto_workspace: {"bind": "/app/auto_gpt_workspace", "mode": "rw"},
f"{self.auto_gpt_path}/autogpt": {"bind": "/app/autogpt", "mode": "rw"},
},
stdin_open=True,
tty=True,
@ -103,11 +105,12 @@ class AutoGPTAgent:
"""
while True:
if self.output_file.exists():
print("Output file exists")
return self.output_file.read_text()
def __init__(self, prompt, auto_gpt_path: str):
self.auto_gpt_path = Path(auto_gpt_path)
self.auto_workspace = self.auto_gpt_path / "auto_gpt_workspace"
self.auto_workspace = self.auto_gpt_path / "autogpt" / "auto_gpt_workspace"
# if the workspace doesn't exist, create it
if not self.auto_workspace.exists():
self.auto_workspace.mkdir()

View File

@ -56,8 +56,7 @@ def parse_args() -> argparse.Namespace:
"--visible", action=argparse.BooleanOptionalAction, default=None)
parser.add_argument("--seed", type=int, default=20220722)
parser.add_argument("--user", type=str, default="")
parser.add_argument("--record_path", type=str, default=str(Path(
__file__).parent.parent / "data" / f"eval-{datetime.now().strftime('%Y%m%d-%H%M%S')}.jsonl"))
parser.add_argument("--record_path", type=str, default=None)
parser.add_argument(
"--log_to_file", type=str, default=None, # default=str(
# Path(__file__).parent.parent / "data" / "log" / "log.txt"
@ -133,6 +132,9 @@ if __name__ == "__main__":
# Obviously, a top level import would be better. This allows us to set the API key with the env file, as it gets
# set in the evaluator. We can't set it before the import because the import will fail without an API key.
from auto_gpt_benchmarking.Evaluator import Evaluator, OAIRunArgs
if args.record_path is None:
args.record_path = str(Path(
__file__).parent.parent / "data" / f"eval-{args.eval}-{datetime.now().strftime('%Y%m%d-%H%M%S')}.jsonl")
run_args = OAIRunArgs(
completion_fn=args.completion_fn,
eval=args.eval,