Spaces:
Runtime error
Runtime error
m00913563 commited on
Commit ·
f8fbe87
1
Parent(s): 482e35f
fix eval
Browse files- evaluator.py +3 -3
evaluator.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
from openai import OpenAI
|
| 2 |
from models import Evaluation
|
| 3 |
-
from typing import List
|
| 4 |
import json
|
| 5 |
tags = {'AI': "This one is the competence description"} #list of competence to save, better to hit db.
|
| 6 |
client = OpenAI()
|
|
@@ -105,7 +105,7 @@ def gpt_evaluator(payload, fewshot, response_format):
|
|
| 105 |
{"role": "system", "content": fewshot},
|
| 106 |
{"role": "user", "content": payload},
|
| 107 |
],
|
| 108 |
-
response_format=
|
| 109 |
json_str = response.choices[0].message.parsed
|
| 110 |
return json_str
|
| 111 |
|
|
@@ -187,7 +187,7 @@ def evaluate_interview(competences: list[str], transcript: list):
|
|
| 187 |
RETURN IN FORMAT BELOW:
|
| 188 |
[{"label": "SUCCESS"},{"label": "FAIL"}]
|
| 189 |
""",
|
| 190 |
-
List[
|
| 191 |
)
|
| 192 |
## output:
|
| 193 |
final_score = 0
|
|
|
|
| 1 |
from openai import OpenAI
|
| 2 |
from models import Evaluation
|
| 3 |
+
from typing import List, Dict
|
| 4 |
import json
|
| 5 |
tags = {'AI': "This one is the competence description"} #list of competence to save, better to hit db.
|
| 6 |
client = OpenAI()
|
|
|
|
| 105 |
{"role": "system", "content": fewshot},
|
| 106 |
{"role": "user", "content": payload},
|
| 107 |
],
|
| 108 |
+
response_format=response_format)
|
| 109 |
json_str = response.choices[0].message.parsed
|
| 110 |
return json_str
|
| 111 |
|
|
|
|
| 187 |
RETURN IN FORMAT BELOW:
|
| 188 |
[{"label": "SUCCESS"},{"label": "FAIL"}]
|
| 189 |
""",
|
| 190 |
+
List(Dict[str,str])
|
| 191 |
)
|
| 192 |
## output:
|
| 193 |
final_score = 0
|