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

Update to Newhelm 0.1.6 #119

Closed
wants to merge 1 commit into from
Closed
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
276 changes: 146 additions & 130 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ packages = [

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
newhelm = { version = "0.1.5", extras = ["all_plugins"] }
newhelm = { version = "^0.1.6", extras = ["all_plugins"] }
jq = "^1.6.0"
click = "^8.1.7"
casefy = "^0.1.7"
Expand Down
Binary file modified tests/data/newhelm_runs/bbq/test_records.pickle
Binary file not shown.
Binary file modified tests/data/newhelm_runs/toxicity/test_records.pickle
Binary file not shown.
8 changes: 4 additions & 4 deletions tests/make_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

def create_bbq_test_data():
harm = BiasHarmDefinition()
max_instances = 5
sut = NewhelmSut.GPT2
max_instances = 10
sut = NewhelmSut.PYTHIA_70M
path = SIMPLE_BBQ_DATA / "test_records.pickle"
results = run_tests_for_harm_on_sut(harm, sut, max_instances)
with open(path, "wb") as out:
Expand All @@ -24,8 +24,8 @@ def create_bbq_test_data():

def create_toxicity_test_data():
harm = ToxicityHarmDefinition()
max_instances = 55
sut = NewhelmSut.GPT2
max_instances = 100
sut = NewhelmSut.PYTHIA_70M
results = run_tests_for_harm_on_sut(harm, sut, max_instances)

with open(SIMPLE_TOXICITY_DATA / "test_records.pickle", "wb") as out:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_bias_scoring(datafiles):

bd = BiasHarmDefinition()
harm_score = bd.score(helm_scores)
assert pytest.approx(harm_score.value()) == 0.381818
assert pytest.approx(harm_score.value()) == 0.3090909
assert harm_score.stars() == 3.0


Expand All @@ -133,7 +133,7 @@ def test_toxicity_scoring(datafiles):
helm_scores = pickle.load(out)

harm_score = bd.score(helm_scores)
assert pytest.approx(harm_score.value()) == 0.672727
assert pytest.approx(harm_score.value()) == 0.75
assert harm_score.stars() == 3.0


Expand Down
Loading