Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ from sentence_transformers import SentenceTransformer
|
|
| 15 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 16 |
|
| 17 |
# InfoStrings
|
| 18 |
-
from scorer import question_scorer
|
| 19 |
from content import format_error, format_warning, format_log, TITLE, INTRODUCTION_TEXT, SUBMISSION_TEXT, CITATION_BUTTON_LABEL, CITATION_BUTTON_TEXT, model_hyperlink
|
| 20 |
|
| 21 |
TOKEN = os.environ.get("TOKEN", None)
|
|
@@ -228,7 +228,7 @@ def add_new_eval(
|
|
| 228 |
#print(reference_set, flush=True)
|
| 229 |
if len(line['cqs']) < 3: # make sure there are at least 3 cqs
|
| 230 |
return format_warning("Make sure that there are at least 3 questions per intervention, or check that the format is right.")
|
| 231 |
-
for cq in line['cqs'][:
|
| 232 |
cq_text = cq['cq']
|
| 233 |
|
| 234 |
if METRIC == 'similarity':
|
|
@@ -281,7 +281,7 @@ def add_new_eval(
|
|
| 281 |
|
| 282 |
|
| 283 |
#return format_error(score)
|
| 284 |
-
score = sum(scores)/len(
|
| 285 |
print(score, flush=True)
|
| 286 |
|
| 287 |
|
|
|
|
| 15 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 16 |
|
| 17 |
# InfoStrings
|
| 18 |
+
#from scorer import question_scorer
|
| 19 |
from content import format_error, format_warning, format_log, TITLE, INTRODUCTION_TEXT, SUBMISSION_TEXT, CITATION_BUTTON_LABEL, CITATION_BUTTON_TEXT, model_hyperlink
|
| 20 |
|
| 21 |
TOKEN = os.environ.get("TOKEN", None)
|
|
|
|
| 228 |
#print(reference_set, flush=True)
|
| 229 |
if len(line['cqs']) < 3: # make sure there are at least 3 cqs
|
| 230 |
return format_warning("Make sure that there are at least 3 questions per intervention, or check that the format is right.")
|
| 231 |
+
for cq in line['cqs'][:3]: # here only take the first 3 cqs
|
| 232 |
cq_text = cq['cq']
|
| 233 |
|
| 234 |
if METRIC == 'similarity':
|
|
|
|
| 281 |
|
| 282 |
|
| 283 |
#return format_error(score)
|
| 284 |
+
score = sum(scores)/len(scores)*10
|
| 285 |
print(score, flush=True)
|
| 286 |
|
| 287 |
|