Skip to content

Commit

Permalink
Fix config parameter for evaluation scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
drazvan committed Dec 13, 2023
1 parent 423b63d commit cc598c3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion nemoguardrails/eval/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Guardrails Evaluation

For an up-to-date overview about the evaluation tools and experiments for the different types of rails supported by NeMo Guardrails, consult [this page](./../../docs/evaluation/README.md).
For an up-to-date overview about the evaluation tools and experiments for the different types of rails supported by NeMo Guardrails, check out [this page](./../../docs/evaluation/README.md).
2 changes: 1 addition & 1 deletion nemoguardrails/eval/cli/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def topical(
typer.echo(f"Starting the evaluation for app: {config[0]}...")

topical_eval = TopicalRailsEvaluation(
config_path=config[0],
config=config[0],
verbose=verbose,
test_set_percentage=test_percentage,
max_samples_per_intent=max_samples_intent,
Expand Down
4 changes: 2 additions & 2 deletions nemoguardrails/eval/evaluate_factcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class FactCheckEvaluation:

def __init__(
self,
config_path: str,
config: str,
dataset_path: str = "data/factchecking/sample.json",
num_samples: int = 50,
create_negatives: bool = True,
Expand All @@ -55,7 +55,7 @@ def __init__(
- write_outputs: whether to write the predictions to file
"""

self.config_path = config_path
self.config_path = config
self.dataset_path = dataset_path
self.rails_config = RailsConfig.from_path(self.config_path)
self.rails = LLMRails(self.rails_config)
Expand Down
4 changes: 2 additions & 2 deletions nemoguardrails/eval/evaluate_hallucination.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class HallucinationRailsEvaluation:

def __init__(
self,
config_path: str,
config: str,
dataset_path: str = "data/hallucination/sample.txt",
num_samples: int = 50,
output_dir: str = "outputs/hallucination",
Expand All @@ -52,7 +52,7 @@ def __init__(
- write_outputs: whether to write the predictions to file
"""

self.config_path = config_path
self.config_path = config
self.dataset_path = dataset_path
self.rails_config = RailsConfig.from_path(self.config_path)
self.rails = LLMRails(self.rails_config)
Expand Down
4 changes: 2 additions & 2 deletions nemoguardrails/eval/evaluate_moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ModerationRailsEvaluation:

def __init__(
self,
config_path: str,
config: str,
dataset_path: str = "nemoguardrails/nemoguardrails/eval/data/moderation/harmful.txt",
num_samples: int = 50,
check_input: bool = True,
Expand All @@ -54,7 +54,7 @@ def __init__(
- split: whether the dataset is harmful or helpful
"""

self.config_path = config_path
self.config_path = config
self.dataset_path = dataset_path
self.rails_config = RailsConfig.from_path(self.config_path)
self.rails = LLMRails(self.rails_config)
Expand Down
4 changes: 2 additions & 2 deletions nemoguardrails/eval/evaluate_topical.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _print_evaluation_results(

def __init__(
self,
config_path: str,
config: str,
verbose: Optional[bool] = False,
test_set_percentage: Optional[float] = 0.3,
max_tests_per_intent: Optional[int] = 3,
Expand All @@ -162,7 +162,7 @@ def __init__(
- random_seed: Random seed used by the evaluation.
- output_dir: Output directory for predictions.
"""
self.config_path = config_path
self.config_path = config
self.verbose = verbose
self.test_set_percentage = test_set_percentage
self.max_tests_per_intent = max_tests_per_intent
Expand Down

0 comments on commit cc598c3

Please sign in to comment.