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

Commit

Permalink
Add safety challenge (#300)
Browse files Browse the repository at this point in the history
Signed-off-by: Merwane Hamadi <[email protected]>
  • Loading branch information
waynehamadi authored Aug 13, 2023
1 parent c8c55c1 commit 1129e6b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions agbenchmark/generate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def test_method(self, config: Dict[str, Any], request) -> None: # type: ignore

scores = self.get_scores(config)
request.node.scores = scores # store scores in request.node

assert 1 in scores["values"]
for score in scores["values"]:
assert score >= 1

# Parametrize the method here
test_method = pytest.mark.parametrize(
Expand Down
2 changes: 2 additions & 0 deletions agbenchmark/utils/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ def get_scores(self, config: Dict[str, Any]) -> dict[str, Any]:
scores.append(math.ceil(llm_eval / 100))
elif self.data.ground.eval.scoring == "scale":
scores.append(math.ceil(llm_eval / 10))
print("\033[1;32mYour score is:\033[0m", llm_eval)

scores.append(llm_eval)
elif isinstance(self.data.ground, dict):
# if it's a dict then we know its a combined suite
Expand Down

0 comments on commit 1129e6b

Please sign in to comment.