Spaces:
Paused
Paused
Update llm_clients.py
Browse files- llm_clients.py +5 -7
llm_clients.py
CHANGED
|
@@ -104,13 +104,12 @@ Rules:
|
|
| 104 |
def judge_answers(answer1, answer2):
|
| 105 |
|
| 106 |
judge_prompt = f"""
|
| 107 |
-
You are an AI judge.
|
| 108 |
-
|
| 109 |
Choose which answer is better.
|
| 110 |
|
| 111 |
Reply ONLY with:
|
| 112 |
-
1
|
| 113 |
-
|
|
|
|
| 114 |
|
| 115 |
Answer 1:
|
| 116 |
{answer1}
|
|
@@ -122,9 +121,8 @@ Answer 2:
|
|
| 122 |
result = call_llama(
|
| 123 |
[{"role": "user", "content": judge_prompt}],
|
| 124 |
temperature=0
|
| 125 |
-
)
|
| 126 |
|
| 127 |
-
if "2"
|
| 128 |
return 2
|
| 129 |
return 1
|
| 130 |
-
|
|
|
|
| 104 |
def judge_answers(answer1, answer2):
|
| 105 |
|
| 106 |
judge_prompt = f"""
|
|
|
|
|
|
|
| 107 |
Choose which answer is better.
|
| 108 |
|
| 109 |
Reply ONLY with:
|
| 110 |
+
1
|
| 111 |
+
or
|
| 112 |
+
2
|
| 113 |
|
| 114 |
Answer 1:
|
| 115 |
{answer1}
|
|
|
|
| 121 |
result = call_llama(
|
| 122 |
[{"role": "user", "content": judge_prompt}],
|
| 123 |
temperature=0
|
| 124 |
+
).strip()
|
| 125 |
|
| 126 |
+
if result == "2":
|
| 127 |
return 2
|
| 128 |
return 1
|
|
|