Skip to content

Commit

Permalink
Refactor: removed model_map and it's imports.
Browse files Browse the repository at this point in the history
Since, the reason of removing of model_map is explained in previous commits, so
removed those dependecies inside hallucination_model too.
  • Loading branch information
Anindyadeep committed Nov 23, 2023
1 parent 8a91d4e commit e401a25
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions deepeval/models/hallucination_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@
from deepeval.singleton import Singleton
from sentence_transformers import CrossEncoder
from deepeval.progress_context import progress_context
from deepeval.models.model_map import model_map, name_to_card


class HallucinationModel(metaclass=Singleton):
def __init__(self, model_name: str = "vectara-hallucination"):
def __init__(self, model_name: str = "vectara/hallucination_evaluation_model"):
# We use a smple cross encoder model
os.environ["TOKENIZERS_PARALLELISM"] = "false"

# TODO: add this progress context in the correct place
with progress_context(
"Downloading HallucinationEvaluationModel (may take up to 2 minutes if running for the first time)..."
):
model_name = name_to_card(model_name)
self.model = CrossEncoder(model_name)

0 comments on commit e401a25

Please sign in to comment.