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

giskard.rag.report.save fails if evaluate doesn't include KnowlegeBase #2097

Open
gotsysdba opened this issue Jan 15, 2025 · 0 comments
Open

Comments

@gotsysdba
Copy link

Issue Type

Bug

Source

source

Giskard Library Version

2.16.0

OS Platform and Distribution

OL9

Python version

3.11

Installed python packages

No response

Current Behaviour?

Running an evaluate without knowledge_base:

report = evaluate(get_answer, testset=loaded_testset)

An attempt to save the report:

report.save("/tmp/report")

Results in:

  File "/app/.venv/lib64/python3.11/site-packages/giskard/rag/report.py", line 161, in save
    self._knowledge_base._knowledge_base_df.to_json(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute '_knowledge_base_df'

Expected the following files to be written to /tmp:

  • testset.jsonl
  • report_details.json
  • metrics_results.json

Maybe empty files of:

  • knowledge_base.jsonl
  • knowledge_base_meta.json

So that they can be load can be run on them later.



### Standalone code OR list down the steps to reproduce the issue

```shell
loaded_testset = QATestset.load("/tmp/ts/testset.jsonl")
report = evaluate(get_answer, testset=loaded_testset)
report.save("/tmp/report")

Relevant log output

/app/.venv/lib64/python3.11/site-packages/giskard/rag/report.py", line 161, in save
    self._knowledge_base._knowledge_base_df.to_json(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute '_knowledge_base_df'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant