From 07f707c5a236a5337356907302e024aa6a804b1b Mon Sep 17 00:00:00 2001 From: aasavari Date: Fri, 18 Oct 2024 03:16:11 +0000 Subject: [PATCH 1/2] small fix for ragas.py Signed-off-by: aasavari --- evals/metrics/ragas/ragas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evals/metrics/ragas/ragas.py b/evals/metrics/ragas/ragas.py index c80ff94e..a2598773 100644 --- a/evals/metrics/ragas/ragas.py +++ b/evals/metrics/ragas/ragas.py @@ -123,7 +123,7 @@ def measure(self, test_case: Dict): else: if metric == "AnswerRelevancy" and self.embeddings is None: raise ValueError("AnswerRelevancy metric need provide embeddings model.") - tmp_metrics.append(self.metrics_instance[metric]) + tmp_metrics.append(self.metrics_instances[metric]) self.metrics = tmp_metrics else: self.metrics = list(self.metric_instances.values()) From 2de5335a78fa2232c6d8016faabb41037f2688b1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 03:14:51 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- evals/benchmark/benchmark.py | 2 +- evals/benchmark/utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/evals/benchmark/benchmark.py b/evals/benchmark/benchmark.py index 8ce76c83..ccb73a3c 100644 --- a/evals/benchmark/benchmark.py +++ b/evals/benchmark/benchmark.py @@ -248,7 +248,7 @@ def run_service_test(example, service_type, service, test_suite_config): deployment_type, test_suite_config.get("service_ip"), test_suite_config.get("service_port"), - test_suite_config.get("namespace") + test_suite_config.get("namespace"), ) base_url = f"http://{svc_ip}:{port}" diff --git a/evals/benchmark/utils.py b/evals/benchmark/utils.py index 2256f0c3..d66212a0 100644 --- a/evals/benchmark/utils.py +++ b/evals/benchmark/utils.py @@ -29,8 +29,10 @@ def write_json(data, filename): logging.error(f"Failed to write {filename}: {e}") return False + from kubernetes import client, config + def get_service_cluster_ip(service_name, namespace="default"): # Load the Kubernetes configuration config.load_kube_config() # or use config.load_incluster_config() if running inside a Kubernetes pod