Spaces:
Running
on
Zero
Running
on
Zero
DongfuJiang
commited on
Commit
•
3ff328c
1
Parent(s):
554396f
update
Browse files
app.py
CHANGED
@@ -23,17 +23,17 @@ for i, ex in enumerate(SHUFFLED_EXAMPLES_DATASET.take(100)):
|
|
23 |
# continue
|
24 |
EXAMPLES.append([ex[field] for field in fields])
|
25 |
|
26 |
-
|
27 |
|
28 |
def submit_fn(input_context, generation_instruction, hypo_output, max_new_tokens=512, temperature=0.7, top_p=1.0):
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
return "None"
|
38 |
|
39 |
|
|
|
23 |
# continue
|
24 |
EXAMPLES.append([ex[field] for field in fields])
|
25 |
|
26 |
+
scorer = TIGERScorer("TIGER-Lab/TIGERScore-7B-GGUF", use_llamacpp=True)
|
27 |
|
28 |
def submit_fn(input_context, generation_instruction, hypo_output, max_new_tokens=512, temperature=0.7, top_p=1.0):
|
29 |
+
return scorer.score(
|
30 |
+
insts=[generation_instruction],
|
31 |
+
hypo_outputs=[hypo_output],
|
32 |
+
input_contexts=[input_context],
|
33 |
+
max_new_tokens=max_new_tokens,
|
34 |
+
temperature=temperature,
|
35 |
+
top_p=top_p,
|
36 |
+
)[0]['raw_output'].strip()
|
37 |
return "None"
|
38 |
|
39 |
|