Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-x-c committed Feb 19, 2024
1 parent 0af0d78 commit 5a6564f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/agentscope/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def read_model_configs(
for cfg in format_configs:
if cfg.config_name in _MODEL_CONFIGS:
raise ValueError(
f"config_name [{cfg.config_name}] already exists."
f"config_name [{cfg.config_name}] already exists.",
)
_MODEL_CONFIGS[cfg.config_name] = cfg

Expand Down
8 changes: 6 additions & 2 deletions tests/model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def test_load_model_configs(self) -> None:
model = load_model_by_config_name("my_post_api")
self.assertEqual(model.config_name, "my_post_api")
self.assertRaises(
ValueError, load_model_by_config_name, "non_existent_id"
ValueError,
load_model_by_config_name,
"non_existent_id",
)

# load a single config
Expand All @@ -95,5 +97,7 @@ def test_load_model_configs(self) -> None:
self.assertEqual(response.text, "test_model_wrapper")
clear_model_configs()
self.assertRaises(
ValueError, load_model_by_config_name, "test_model_wrapper"
ValueError,
load_model_by_config_name,
"test_model_wrapper",
)

0 comments on commit 5a6564f

Please sign in to comment.