Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick fix for ragas.py #165

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion evals/benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 2 additions & 0 deletions evals/benchmark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion evals/metrics/ragas/ragas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down