Skip to content

Commit

Permalink
Additonal params for sagemaker
Browse files Browse the repository at this point in the history
  • Loading branch information
HuXiangkun committed Sep 5, 2024
1 parent b2a41fb commit 809b068
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ragchecker"
version = "0.1.4"
version = "0.1.5"
description = "RAGChecker: A Fine-grained Framework For Diagnosing Retrieval-Augmented Generation (RAG) systems."
authors = [
"Xiangkun Hu <xiangkhu@amazon.com>",
Expand All @@ -15,7 +15,7 @@ license = "Apache-2.0"

[tool.poetry.dependencies]
python = "^3.9"
refchecker = "^0.2.5"
refchecker = "^0.2.6"
loguru = "^0.7"
dataclasses-json = "^0.6"

Expand Down
4 changes: 4 additions & 0 deletions ragchecker/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(
joint_check=True,
joint_check_num=5,
sagemaker_client=None,
sagemaker_params=None,
**kwargs
):
if openai_api_key:
Expand All @@ -61,6 +62,7 @@ def __init__(
self.joint_check_num = joint_check_num
self.kwargs = kwargs
self.sagemaker_client = sagemaker_client
self.sagemaker_params = sagemaker_params

self.extractor = LLMExtractor(
model=extractor_name,
Expand Down Expand Up @@ -108,6 +110,7 @@ def extract_claims(self, results: List[RAGResult], extract_type="gt_answer"):
batch_questions=questions,
max_new_tokens=self.extractor_max_new_tokens,
sagemaker_client=self.sagemaker_client,
sagemaker_params=self.sagemaker_params,
**self.kwargs
)
claims = [[c.content for c in res.claims] for res in extraction_results]
Expand Down Expand Up @@ -169,6 +172,7 @@ def check_claims(self, results: RAGResults, check_type="answer2response"):
is_joint=self.joint_check,
joint_check_num=self.joint_check_num,
sagemaker_client=self.sagemaker_client,
sagemaker_params=self.sagemaker_params,
**self.kwargs
)
for i, result in enumerate(results):
Expand Down

0 comments on commit 809b068

Please sign in to comment.