Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
Fangrui Liu committed Aug 24, 2023
1 parent 8fca769 commit 7adee0c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions retrieval_qa_benchmark/schema/evaluator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import List, Optional, Tuple, Callable
from typing import Callable, List, Optional, Tuple

from loguru import logger
from pydantic import BaseModel, Extra
Expand All @@ -16,14 +16,17 @@
from retrieval_qa_benchmark.utils.profiler import PROFILER


def default_matcher(x: str, y: QARecord) -> float:
return float(x == y.answer)


class BaseEvaluator(BaseModel):
"""Base class for evaluators"""

dataset: BaseDataset
llm: BaseLLM
transform: TransformGraph
matcher: Callable[[str, QARecord], float] = \
lambda x, y: float(x == y.answer) # noqa: E731
matcher: Callable[[str, QARecord], float] = default_matcher
out_file: Optional[str] = None

class Config:
Expand Down

0 comments on commit 7adee0c

Please sign in to comment.