deepeval icon indicating copy to clipboard operation
deepeval copied to clipboard

Disk Error When Attempting to Run Tests

Open pgarz opened this issue 1 year ago • 34 comments

Describe the bug I get a disk error when trying to run a test. Might be a bug in how some temp file is being cached by the DeepEval library

To Reproduce

import pytest
from deepeval.metrics.factual_consistency import FactualConsistencyMetric
from deepeval.metrics.answer_relevancy import AnswerRelevancyMetric
from deepeval.metrics.conceptual_similarity import ConceptualSimilarityMetric

from deepeval.test_case import LLMTestCase
from deepeval.evaluator import run_test


def compute_deep_eval_metric(question, ground_truth_answer, pred_answer, context):

  factual_consistency_metric = FactualConsistencyMetric(minimum_score=0.7)
  answer_relevancy_metric = AnswerRelevancyMetric(minimum_score=0.7)
  conceptual_similarity_metric = ConceptualSimilarityMetric(minimum_score=0.7)

  test_case = LLMTestCase(input=question, actual_output=pred_answer, context=context, expected_output=ground_truth_answer)
  results = run_test(test_case, [factual_consistency_metric, answer_relevancy_metric, conceptual_similarity_metric])

My stack trace is as follows

/usr/local/lib/python3.10/dist-packages/transformers/convert_slow_tokenizer.py:473: UserWarning: The sentencepiece 
tokenizer that you are converting to a fast tokenizer uses the byte fallback option which is not implemented in the
fast tokenizers. In practice this means that the fast version of the tokenizer can produce unknown tokens whereas 
the sentencepiece version would have converted these unknown tokens into a sequence of byte tokens matching the 
original piece of text.
  warnings.warn(
Error loading test run from disk
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-10-82f04413d550>](https://localhost:8080/#) in <cell line: 44>()
     42 expected_output_x = answers[1]
     43 
---> 44 x = compute_deep_eval_metric(input_x, expected_output_x, actual_output_x, context_x)

1 frames
[/usr/local/lib/python3.10/dist-packages/deepeval/evaluator.py](https://localhost:8080/#) in run_test(test_cases, metrics, max_retries, delay, min_success, raise_error)
     90             # metric.score = score
     91 
---> 92             test_run_manager.get_test_run().add_llm_test_case(
     93                 test_case=test_case,
     94                 metrics=[metric],

AttributeError: 'NoneType' object has no attribute 'add_llm_test_case'/usr/local/lib/python3.10/dist-packages/transformers/convert_slow_tokenizer.py:473: UserWarning: The sentencepiece 
tokenizer that you are converting to a fast tokenizer uses the byte fallback option which is not implemented in the
fast tokenizers. In practice this means that the fast version of the tokenizer can produce unknown tokens whereas 
the sentencepiece version would have converted these unknown tokens into a sequence of byte tokens matching the 
original piece of text.
  warnings.warn(
Error loading test run from disk
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-10-82f04413d550>](https://localhost:8080/#) in <cell line: 44>()
     42 expected_output_x = answers[1]
     43 
---> 44 x = compute_deep_eval_metric(input_x, expected_output_x, actual_output_x, context_x)

1 frames
[/usr/local/lib/python3.10/dist-packages/deepeval/evaluator.py](https://localhost:8080/#) in run_test(test_cases, metrics, max_retries, delay, min_success, raise_error)
     90             # metric.score = score
     91 
---> 92             test_run_manager.get_test_run().add_llm_test_case(
     93                 test_case=test_case,
     94                 metrics=[metric],

AttributeError: 'NoneType' object has no attribute 'add_llm_test_case'

pgarz avatar Nov 14 '23 22:11 pgarz