Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

fix home_path, local mini-agi run works #64

Merged
merged 2 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions agbenchmark/agent_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ def run_agent(
)

# Get the current working directory
cwd = os.getcwd()
cwd = os.path.join(os.getcwd(), config["home_path"])

# Add current directory to Python's import path
sys.path.append(cwd)
sys.path.append(os.path.join(cwd, config["home_path"]))

command = [sys.executable, config["entry_path"], str(task)]
process = subprocess.Popen(
Expand Down Expand Up @@ -67,6 +66,7 @@ def run_agent(
print(
"The Python function has exceeded the time limit and was terminated."
)
# Terminate the process group
process.terminate()
break

Expand Down
5 changes: 0 additions & 5 deletions agbenchmark/start_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ def start(category: str, maintain: bool, mock: bool) -> int:

set_key(".env", "MOCK_TEST", "True" if mock else "False")

# create workspace directory if it doesn't exist
workspace_path = os.path.abspath(config["workspace"])
if not os.path.exists(workspace_path):
os.makedirs(workspace_path, exist_ok=True)

if not os.path.exists(REGRESSION_TESTS_PATH):
with open(REGRESSION_TESTS_PATH, "a"):
pass
Expand Down
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"workspace": "projects/my-new-project/workspace",
"workspace": "${os.path.join(Path.home(), 'miniagi')}",
"entry_path": "benchmarks.py",
"home_path": "",
"home_path": "agent/mini-agi/",
"cutoff": 60
}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ markers = [
"retrieval",
"regression",
"basic",
"memory"
]

[tool.poetry.scripts]
Expand Down