Spaces:
Runtime error
Runtime error
m00913563 commited on
Commit ·
1b7e6e5
1
Parent(s): f0c722e
json object
Browse files- evaluator.py +2 -2
evaluator.py
CHANGED
|
@@ -100,12 +100,12 @@ SKILL TO BE EVALUATED: {skill}
|
|
| 100 |
def gpt_evaluator(payload, fewshot, response_format):
|
| 101 |
print("-----tes")
|
| 102 |
response = client.beta.chat.completions.parse(
|
| 103 |
-
model="gpt-4o
|
| 104 |
messages=[
|
| 105 |
{"role": "system", "content": fewshot},
|
| 106 |
{"role": "user", "content": payload},
|
| 107 |
],
|
| 108 |
-
response_format="
|
| 109 |
json_str = response.choices[0].message.content
|
| 110 |
data = json.loads(json_str)
|
| 111 |
return [Evaluation(**item) for item in data]
|
|
|
|
| 100 |
def gpt_evaluator(payload, fewshot, response_format):
|
| 101 |
print("-----tes")
|
| 102 |
response = client.beta.chat.completions.parse(
|
| 103 |
+
model="gpt-4o",
|
| 104 |
messages=[
|
| 105 |
{"role": "system", "content": fewshot},
|
| 106 |
{"role": "user", "content": payload},
|
| 107 |
],
|
| 108 |
+
response_format={type: "json_object"})
|
| 109 |
json_str = response.choices[0].message.content
|
| 110 |
data = json.loads(json_str)
|
| 111 |
return [Evaluation(**item) for item in data]
|