-
Notifications
You must be signed in to change notification settings - Fork 834
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
Changing instruction language yields upload error #1912
Comments
Hi @emseoyk, I tried to reproduce the error, but it worked perfectly fine for me. I used the code below. Can you give it a try and let me know if the problem still persists? from ragas import SingleTurnSample
from ragas.metrics import LLMContextPrecisionWithReference
context_precision = LLMContextPrecisionWithReference(llm=evaluator_llm)
sample = SingleTurnSample(
user_input="에펠탑은 어디에 위치해 있나요?", # "Where is the Eiffel Tower located?" in Korean
reference="에펠탑은 파리에 위치해 있습니다.", # "The Eiffel Tower is located in Paris." in Korean
retrieved_contexts=["에펠탑은 파리에 위치해 있습니다."], # Same context in Korean
)
adapted_prompts = await context_precision.adapt_prompts(language="korean", llm=evaluator_llm)
context_precision.set_prompts(**adapted_prompts)
prompt = context_precision.get_prompts()["context_precision_prompt"]
prompt.instruction += "주어진 질문, 답변 및 컨텍스트를 바탕으로 주어진 답변을 도출하는 데 컨텍스트가 유용했는지 확인하십시오. 유용하다면 '1', 아니라면 '0'으로 판별하여 JSON 출력하십시오."
context_precision.set_prompts(**{"context_precision_prompt": prompt})
result = evaluate(dataset=EvaluationDataset([sample]), metrics=[context_precision])
result.upload() Output ![]() |
Your code works fine, but when I run mine, I still get the error like below. Is there any way I could print result dict that contains all output like verdict, reason, etc? I want to observe the output and find out why.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your Question
Error Message: API Message: An internal server error occurred
).Interestingly the result csv with scores is saved successfully, but just the
upload()
doesn't work. I think it has to do with PydanticOutParser, maybe Korean instruction does not match with the predefined keys...But it's just my assumption. Do you happen to know why the instruction doesn't work on other languages?
result.to_pandas()
. I am usingcontext_precision, context_recall, answer_relevancy, answer_correctness, faithfulness
for evaluation metrics.The text was updated successfully, but these errors were encountered: