Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hot Fix] Fix the bug that the save_dir is not effective #263

Merged
merged 2 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/agentscope/_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ def init_process(
if runtime_id is not None:
_runtime.runtime_id = runtime_id

# Init file manager and save configs by default
file_manager.init(save_dir, save_api_invoke)

# Init logger
dir_log = str(file_manager.dir_log) if save_log else None
setup_logger(dir_log, logger_level)
Expand All @@ -170,9 +173,6 @@ def init_process(
if model_configs is not None:
read_model_configs(model_configs)

# Init file manager and save configs by default
file_manager.init(save_dir, save_api_invoke)

# Init monitor
_ = MonitorFactory.get_monitor(
db_path=file_manager.path_db,
Expand Down
6 changes: 4 additions & 2 deletions tests/rpc_agent_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""
import unittest
import time
import os
import shutil
from loguru import logger

Expand Down Expand Up @@ -159,14 +160,15 @@ def setUp(self) -> None:
agentscope.init(
project="test",
name="rpc_agent",
save_dir="./test_runs",
save_dir="./.unittest_runs",
save_log=True,
)
self.assertTrue(os.path.exists("./.unittest_runs"))

def tearDown(self) -> None:
MonitorFactory._instance = None # pylint: disable=W0212
logger.remove()
shutil.rmtree("./test_runs")
shutil.rmtree("./.unittest_runs")

def test_single_rpc_agent_server(self) -> None:
"""test setup a single rpc agent"""
Expand Down