fixing relative imports

This commit is contained in:
Silen Naihin
2023-06-26 09:36:13 -04:00
parent b6562f3420
commit 84f170c9e0
2 changed files with 12 additions and 4 deletions

View File

@@ -17,8 +17,10 @@ def start(category, noreg):
"""Start the benchmark tests. If a category flag is provided, run the categories with that mark."""
config_file = "agbenchmark/config.json"
config_dir = os.path.abspath(config_file)
# Check if configuration file exists and is not empty
if not os.path.exists(config_file) or os.stat(config_file).st_size == 0:
if not os.path.exists(config_dir) or os.stat(config_dir).st_size == 0:
config = {}
config["hostname"] = click.prompt(
@@ -26,16 +28,21 @@ def start(category, noreg):
)
config["port"] = click.prompt("Please enter a new port", default=8080)
config["workspace"] = click.prompt(
"Please enter a new workspace path", default="/path/to/workspace"
"Please enter a new workspace path", default="agbenchmark/mocks/workspace"
)
with open(config_file, "w") as f:
with open(config_dir, "w") as f:
json.dump(config, f)
else:
# If the configuration file exists and is not empty, load it
with open(config_file, "r") as f:
with open(config_dir, "r") as f:
config = json.load(f)
# create workspace directory if it doesn't exist
workspace_path = config_dir = os.path.abspath(config["workspace"])
if not os.path.exists(workspace_path):
os.makedirs(workspace_path, exist_ok=True)
print("Current configuration:")
for key, value in config.items():
print(f"{key}: {value}")

1
agent/mini-agi Submodule

Submodule agent/mini-agi added at d2add8f18c