Spaces:
Running
Running
arvind6599
commited on
Commit
·
a885316
1
Parent(s):
9c745ef
Removed string handling
Browse files
app.py
CHANGED
|
@@ -207,44 +207,44 @@ def submit_prompt(email, name, system_prompt_1, system_prompt_2, system_prompt_3
|
|
| 207 |
|
| 208 |
verdict = ""
|
| 209 |
|
| 210 |
-
# When the expected output is a string, it indicates that the query was irrelevant.
|
| 211 |
-
if isinstance(expected, str):
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
|
| 236 |
# If the expected output is a JSON object but answer is a String
|
| 237 |
-
if notRelevant and not isinstance(expected, str):
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
|
| 249 |
try:
|
| 250 |
parsed_answer = json.loads(answer)
|
|
@@ -469,13 +469,6 @@ Target Company Mentioned: No
|
|
| 469 |
}
|
| 470 |
```
|
| 471 |
|
| 472 |
-
| Field | Default Value if Missing | Type |
|
| 473 |
-
| ---------------------- | ------------------------ | --------- |
|
| 474 |
-
| `buyer_firm` | `"unknown"` | `string` |
|
| 475 |
-
| `seller_firm` | `"unknown"` | `string` |
|
| 476 |
-
| `third_party` | `"unknown"` | `string` |
|
| 477 |
-
| `contains_target_firm` | `false` | `boolean` |
|
| 478 |
-
|
| 479 |
""")
|
| 480 |
|
| 481 |
# Challenge instructions and testing guidance
|
|
|
|
| 207 |
|
| 208 |
verdict = ""
|
| 209 |
|
| 210 |
+
# # When the expected output is a string, it indicates that the query was irrelevant.
|
| 211 |
+
# if isinstance(expected, str):
|
| 212 |
+
# if notRelevant:
|
| 213 |
+
# verdict = f"Correct"
|
| 214 |
+
# score += 1
|
| 215 |
+
# responses.append(
|
| 216 |
+
# f"Question: {question}\n"
|
| 217 |
+
# f"Answer: {answer}\n"
|
| 218 |
+
# f"Expected: {expected}\n"
|
| 219 |
+
# f"Result: {verdict}\n"
|
| 220 |
+
# )
|
| 221 |
+
# verdicts.append(verdict)
|
| 222 |
+
# answers_list.append(answer)
|
| 223 |
+
# continue
|
| 224 |
+
# else:
|
| 225 |
+
# verdict = "Incorrect (Query was irrelevant, but no user message found)"
|
| 226 |
+
# responses.append(
|
| 227 |
+
# f"Question: {question}\n"
|
| 228 |
+
# f"Answer: {answer}\n"
|
| 229 |
+
# f"Expected: {expected}\n"
|
| 230 |
+
# f"Result: {verdict}\n"
|
| 231 |
+
# )
|
| 232 |
+
# verdicts.append(verdict)
|
| 233 |
+
# answers_list.append(answer)
|
| 234 |
+
# continue
|
| 235 |
|
| 236 |
# If the expected output is a JSON object but answer is a String
|
| 237 |
+
# if notRelevant and not isinstance(expected, str):
|
| 238 |
+
# verdict = "Incorrect (Query was relevant, but user message found)"
|
| 239 |
+
# responses.append(
|
| 240 |
+
# f"Question: {question}\n"
|
| 241 |
+
# f"Answer: {answer}\n"
|
| 242 |
+
# f"Expected: {json.dumps(expected)}\n"
|
| 243 |
+
# f"Result: {verdict}\n"
|
| 244 |
+
# )
|
| 245 |
+
# verdicts.append(verdict)
|
| 246 |
+
# answers_list.append(answer)
|
| 247 |
+
# continue
|
| 248 |
|
| 249 |
try:
|
| 250 |
parsed_answer = json.loads(answer)
|
|
|
|
| 469 |
}
|
| 470 |
```
|
| 471 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 472 |
""")
|
| 473 |
|
| 474 |
# Challenge instructions and testing guidance
|