Instructions to use vectara/hallucination_evaluation_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vectara/hallucination_evaluation_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="vectara/hallucination_evaluation_model", trust_remote_code=True)# Load model directly from transformers import AutoModelForSequenceClassification model = AutoModelForSequenceClassification.from_pretrained("vectara/hallucination_evaluation_model", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
not loading from checkpoint
This model is not packed correctly and I am not even sure it loads the model checkpoint shared on this repo.
It could inherit from T5 and also store the tokenizer here.
can you provide more details such as the code to show you tried and the error message?
I feel that the model should be packed as a T5 model, with the predict logic on the pipeline (not pulling a tokenizer from another repo on the init).
I will try to put together a PR with the changes.
Ok, did some repack here:
https://huggingface.co/tcapelle/hallu_scorer
The issue I was facing is that we shouldn't load a tokenizer during model init, that's what the pipeline should be doing.
Also, the underlying model is just a flan-t5-base for token classification, no need to subclass. We could put the prompt template in the tokenizer actually.
Did you try this approach that makes use of pipeline?
https://huggingface.co/vectara/hallucination_evaluation_model#using-with-pipeline
I think this is coming from how the sentence_transformers packages the model.