Spaces:
Runtime error
Runtime error
SujanMidatani
commited on
Commit
•
156026c
1
Parent(s):
5fa769b
update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,8 @@ def indiQuesGrade(question, answer, role, exp):
|
|
27 |
{{experience}}
|
28 |
|
29 |
Now, generate the grading measures according to the above question, role and experience values.
|
30 |
-
|
|
|
31 |
{{~/user}}
|
32 |
{{#assistant~}}
|
33 |
{{gen 'grading_measures' temperature=0.7 max_tokens=150}}
|
@@ -41,12 +42,18 @@ def indiQuesGrade(question, answer, role, exp):
|
|
41 |
Output the evaluation in a JSON Format with the grading measure as key and a dictionary of score and reason as value.
|
42 |
The score key contains a numerical measure depicting the answer against grading measure and the reason key contains text information
|
43 |
about why the answer was such given such numerical grade in the evaluation measure.
|
|
|
|
|
|
|
|
|
|
|
44 |
{{~/user}}
|
45 |
{{#assistant~}}
|
46 |
-
{{gen 'evaluation' temperature=0.5
|
47 |
{{~/assistant}}
|
48 |
''', llm = evaluatorModel)
|
49 |
-
|
|
|
50 |
k=gr.Interface(
|
51 |
fn=indiQuesGrade,
|
52 |
inputs=['text','text','text','text'],
|
|
|
27 |
{{experience}}
|
28 |
|
29 |
Now, generate the grading measures according to the above question, role and experience values.
|
30 |
+
The grading measures must be generated as a array elements with names as the grading rubrics. They are placed between two square brackets, separated by commas.
|
31 |
+
Do not output the grading measures yet.
|
32 |
{{~/user}}
|
33 |
{{#assistant~}}
|
34 |
{{gen 'grading_measures' temperature=0.7 max_tokens=150}}
|
|
|
42 |
Output the evaluation in a JSON Format with the grading measure as key and a dictionary of score and reason as value.
|
43 |
The score key contains a numerical measure depicting the answer against grading measure and the reason key contains text information
|
44 |
about why the answer was such given such numerical grade in the evaluation measure.
|
45 |
+
|
46 |
+
Add the key of overall score to the output JSON with a dictionary as it's value. The dictionary must have two keys, score, depecting the numerical measure
|
47 |
+
as a overall evaluations score, graded against a score of 5 and the other key as reason, showing a Justification Statement.
|
48 |
+
|
49 |
+
The output response must only contain a JSON File of evaluation. Do not output any additional information other than it.
|
50 |
{{~/user}}
|
51 |
{{#assistant~}}
|
52 |
+
{{gen 'evaluation' temperature=0.5 max_tokens=1500}}
|
53 |
{{~/assistant}}
|
54 |
''', llm = evaluatorModel)
|
55 |
+
output = evaluationSys(question=question, role = role, experience = exp, answer = answer)
|
56 |
+
return output['evaluation'], output['grading_measures']
|
57 |
k=gr.Interface(
|
58 |
fn=indiQuesGrade,
|
59 |
inputs=['text','text','text','text'],
|