Error while importing TrueEra trulens-eval

772 views Asked by At

I'm trying to replicate the amazing tutorial from llama_index and truera on DLAI: https://learn.deeplearning.ai/building-evaluating-advanced-rag I running the code inside a docker container on one of our machine through ssh connection: The cmd to run the docker is the following:

sudo docker run -it --rm -v /data:/data -v "/root/.cache:/root/.cache" --name llama-zephyr-notebook --gpus all -p 8888:8888 jupyter/base-notebook

I installed the trulen_eval module using pip:

!pip install trulens_eval

When I tried the tutorial inside the DLAI env it worked perfectly but when I run this section of the notebook:

from trulens_eval import Tru

I have the following error:

Cell In[20], line 1
----> 1 from trulens_eval import Tru
      2 tru = Tru()
      4 tru.reset_database()

File /opt/conda/lib/python3.11/site-packages/trulens_eval/__init__.py:83
      1 """
      2 # Trulens-eval LLM Evaluation Library
      3 
   (...)
     78 
     79 """
     81 __version__ = "0.18.2"
---> 83 from trulens_eval.feedback import Bedrock
     84 from trulens_eval.feedback import Feedback
     85 from trulens_eval.feedback import Huggingface

File /opt/conda/lib/python3.11/site-packages/trulens_eval/feedback/__init__.py:14
     11 AggCallable = Callable[[Iterable[float]], float]
     13 # Specific feedback functions:
---> 14 from trulens_eval.feedback.embeddings import Embeddings
     15 # Main class holding and running feedback functions:
     16 from trulens_eval.feedback.feedback import Feedback

File /opt/conda/lib/python3.11/site-packages/trulens_eval/feedback/embeddings.py:8
      5 from pydantic import PrivateAttr
      7 from trulens_eval.utils.imports import REQUIREMENT_SKLEARN
----> 8 from trulens_eval.utils.pyschema import WithClassInfo
      9 from trulens_eval.utils.serial import SerialModel
     12 class Embeddings(SerialModel, WithClassInfo):

File /opt/conda/lib/python3.11/site-packages/trulens_eval/utils/pyschema.py:589
    585 # Key of structure where class information is stored.
    586 CLASS_INFO = "__tru_class_info"
--> 589 class WithClassInfo(pydantic.BaseModel):
    590     """
    591     Mixin to track class information to aid in querying serialized components
    592     without having to load them.
    593     """
    595     # Using this odd key to not pollute attribute names in whatever class we mix
    596     # this into. Should be the same as CLASS_INFO.

File /opt/conda/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py:92, in __new__(mcs, cls_name, bases, namespace, __pydantic_generic_metadata__, __pydantic_reset_parent_namespace__, _create_model_module, **kwargs)

File /opt/conda/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py:347, in inspect_namespace(namespace, ignored_types, base_class_vars, base_class_fields)

NameError: Fields must not use names with leading underscores; e.g., use 'WithClassInfo__tru_class_info' instead of '_WithClassInfo__tru_class_info'.


Did anyone else face this? Do you have any clue about the solution?

I wanted to use the evaluation module locally without using openai but rather zephyr beta.

0

There are 0 answers