add info func
Browse files- parapluie.py +16 -1
parapluie.py
CHANGED
|
@@ -112,11 +112,26 @@ class Parapluie(evaluate.Metric):
|
|
| 112 |
):
|
| 113 |
self.scorer = ppluie(model, device, template, use_chat_template, half_mode, n_right_specials_tokens)
|
| 114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
def _compute(self, sources, hypotheses):
|
| 116 |
"""Returns the scores"""
|
| 117 |
scores = []
|
| 118 |
for i in range(len(sources)):
|
| 119 |
-
print("'aojraoijoafoaif")
|
| 120 |
scores.append(self.scorer(sources[i], hypotheses[i]))
|
| 121 |
return {
|
| 122 |
"scores": scores,
|
|
|
|
| 112 |
):
|
| 113 |
self.scorer = ppluie(model, device, template, use_chat_template, half_mode, n_right_specials_tokens)
|
| 114 |
|
| 115 |
+
def show_templates(self):
|
| 116 |
+
# to show available prompting templates styles
|
| 117 |
+
self.scorer.show_templates()
|
| 118 |
+
|
| 119 |
+
def check_end_tokens_tmpl(self):
|
| 120 |
+
# to show how is the prompt encoded, to ensure that the correct numbers of special tokens are removed
|
| 121 |
+
# and Yes / No words fit on one token
|
| 122 |
+
self.scorer.chech_end_tokens_tmpl()
|
| 123 |
+
|
| 124 |
+
def show_available_models(self):
|
| 125 |
+
# to show LLM already tested with ParaPLUIE
|
| 126 |
+
self.scorer.show_available_models()
|
| 127 |
+
|
| 128 |
+
def setTemplate(self, tmplt):
|
| 129 |
+
self.scorer.setTemplate(tmplt)
|
| 130 |
+
|
| 131 |
def _compute(self, sources, hypotheses):
|
| 132 |
"""Returns the scores"""
|
| 133 |
scores = []
|
| 134 |
for i in range(len(sources)):
|
|
|
|
| 135 |
scores.append(self.scorer(sources[i], hypotheses[i]))
|
| 136 |
return {
|
| 137 |
"scores": scores,
|