mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-28 19:34:30 +01:00
Fix home_path, local mini-agi run works (#64)
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
This commit is contained in:
@@ -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(
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ markers = [
|
||||
"retrieval",
|
||||
"regression",
|
||||
"basic",
|
||||
"memory"
|
||||
]
|
||||
|
||||
[tool.poetry.scripts]
|
||||
|
||||
Reference in New Issue
Block a user