Spaces:
Runtime error
Runtime error
Commit
·
9bd9faa
1
Parent(s):
a80a32b
update title of the app
Browse files
app.py
CHANGED
|
@@ -5,15 +5,20 @@
|
|
| 5 |
from typing import List, Literal
|
| 6 |
from IPython.display import display, Markdown
|
| 7 |
from transformers import AutoModelForSequenceClassification
|
|
|
|
| 8 |
|
| 9 |
hhem = AutoModelForSequenceClassification.from_pretrained('vectara/hallucination_evaluation_model', trust_remote_code=True)
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
def HHEM(
|
| 12 |
LLM_Prompt: str = "The sky is blue.",
|
| 13 |
LLM_Response: str = "The ocean is blue."
|
| 14 |
) -> Markdown:
|
| 15 |
-
"""
|
| 16 |
-
|
| 17 |
Vectara's Hughes Hallucination Evaluation Model (HHEM) evaluates how well an LLM's output (called the "response" or the "hypothesis") is faithful/grounded to or supported by the input given to it (called the "prompt" or the "premise"). HHEM has two versions: [HHEM-Open](https://huggingface.co/vectara/hallucination_evaluation_model) and [HHEM Commercial](https://www.vectara.com/blog/hhem-2-1-a-better-hallucination-detection-model).
|
| 18 |
|
| 19 |
To use the demo, fill in the "LLM_Prompt" and "LLM_Response" fields and click the run button. A placeholder example is prefilled for you. Feel free to replace it with your own examples and evaluate them.
|
|
|
|
| 5 |
from typing import List, Literal
|
| 6 |
from IPython.display import display, Markdown
|
| 7 |
from transformers import AutoModelForSequenceClassification
|
| 8 |
+
from funix import funix
|
| 9 |
|
| 10 |
hhem = AutoModelForSequenceClassification.from_pretrained('vectara/hallucination_evaluation_model', trust_remote_code=True)
|
| 11 |
|
| 12 |
+
print ("Loading HHEM, this may take a while.")
|
| 13 |
+
|
| 14 |
+
@funix(
|
| 15 |
+
title= "GUI demo for Vectara's HHEM-2.1-Open"
|
| 16 |
+
)
|
| 17 |
def HHEM(
|
| 18 |
LLM_Prompt: str = "The sky is blue.",
|
| 19 |
LLM_Response: str = "The ocean is blue."
|
| 20 |
) -> Markdown:
|
| 21 |
+
"""
|
|
|
|
| 22 |
Vectara's Hughes Hallucination Evaluation Model (HHEM) evaluates how well an LLM's output (called the "response" or the "hypothesis") is faithful/grounded to or supported by the input given to it (called the "prompt" or the "premise"). HHEM has two versions: [HHEM-Open](https://huggingface.co/vectara/hallucination_evaluation_model) and [HHEM Commercial](https://www.vectara.com/blog/hhem-2-1-a-better-hallucination-detection-model).
|
| 23 |
|
| 24 |
To use the demo, fill in the "LLM_Prompt" and "LLM_Response" fields and click the run button. A placeholder example is prefilled for you. Feel free to replace it with your own examples and evaluate them.
|