Skip to content

Commit

Permalink
minor api change
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreFCruz committed Jun 23, 2024
1 parent 34d2f44 commit 217a045
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion folktexts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ._version import __version__, __version_info__
from .acs import ACSDataset, ACSTaskMetadata
from .task import TaskMetadata
from .benchmark import BenchmarkConfig, CalibrationBenchmark
from .classifier import LLMClassifier
from .acs import ACSDataset, ACSTaskMetadata
6 changes: 3 additions & 3 deletions folktexts/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def evaluate_binary_predictions_fairness(
def group_metric_name(metric_name, group_name):
return f"{metric_name}_group={group_name}"

assert (
len(unique_groups) > 1
), f"Found a single unique sensitive attribute: {unique_groups}"
if len(unique_groups) <= 1:
logging.error(f"Found a single unique sensitive attribute: {unique_groups}")
return {}

for s_value in unique_groups:
# Indices of samples that belong to the current group
Expand Down
2 changes: 1 addition & 1 deletion folktexts/qa_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def create_answer_keys_permutations(cls, question: "MultipleChoiceQA") -> Iterat
yield dataclasses.replace(question, choices=perm)

@property
def answer_keys(self) -> list[str]:
def answer_keys(self) -> tuple[str]:
return self._answer_keys_source[:len(self.choices)]

@property
Expand Down

0 comments on commit 217a045

Please sign in to comment.