Skip to content

Commit

Permalink
fixed a lint issues in train run_id args
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshrvel committed Jan 8, 2025
1 parent c75e1db commit b5e6d46
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/ragas/metrics/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def _optimize_demonstration(
def train(
self,
path: t.Optional[str] = None,
run_id: t.Optional[str] = None,
run_id: str = None,
demonstration_config: t.Optional[DemonstrationConfig] = None,
instruction_config: t.Optional[InstructionConfig] = None,
callbacks: t.Optional[Callbacks] = None,
Expand All @@ -371,7 +371,7 @@ def train(
----------
path : str, optional
Path to local JSON training data file
run_id : str, optional
run_id : str
Direct run ID to fetch annotations
demonstration_config : DemonstrationConfig, optional
Configuration for demonstration optimization
Expand All @@ -396,13 +396,9 @@ def train(
# Validate input parameters
provided_inputs = sum(x is not None for x in [path, run_id])
if provided_inputs == 0:
raise ValueError(
"One of path or run_id must be provided"
)
raise ValueError("One of path or run_id must be provided")
if provided_inputs > 1:
raise ValueError(
"Only one of path or run_id should be provided"
)
raise ValueError("Only one of path or run_id should be provided")

run_config = run_config or RunConfig()
callbacks = callbacks or []
Expand Down Expand Up @@ -437,6 +433,7 @@ def train(
dataset=dataset,
)


@dataclass
class MetricWithEmbeddings(Metric):
embeddings: t.Optional[BaseRagasEmbeddings] = None
Expand Down

0 comments on commit b5e6d46

Please sign in to comment.