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 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())