Spaces:
Running
Running
Update evaluate.py
Browse files- evaluate.py +8 -10
evaluate.py
CHANGED
|
@@ -9,8 +9,8 @@ from typing import List, Dict, Any
|
|
| 9 |
from pathlib import Path
|
| 10 |
|
| 11 |
# --- ADD THIS FLAG ---
|
| 12 |
-
NLU_ONLY_TEST = True
|
| 13 |
-
|
| 14 |
# ---------------------
|
| 15 |
|
| 16 |
# --- Imports from the main application ---
|
|
@@ -195,12 +195,11 @@ def load_test_fixtures():
|
|
| 195 |
# The old code used a relative path, which is unreliable.
|
| 196 |
# This new code builds an absolute path to the fixture file based on
|
| 197 |
# the location of this (evaluate.py) script.
|
| 198 |
-
# script_dir = Path(__file__).parent
|
| 199 |
-
#default_fixture_file = script_dir / "small_test_cases_v10.jsonl"
|
| 200 |
-
#candidates = [env_path] if env_path else [str(default_fixture_file)]
|
| 201 |
-
|
| 202 |
# default_fixture_file = script_dir / "Test_Syn_Caregiving_Patient.jsonl"
|
| 203 |
# candidates = [env_path] if env_path else [str(default_fixture_file)]
|
|
|
|
|
|
|
|
|
|
| 204 |
|
| 205 |
# --- END: DEFINITIVE FIX ---
|
| 206 |
# candidates = [env_path] if env_path else ["conversation_test_fixtures_v10.jsonl"]
|
|
@@ -212,15 +211,13 @@ def load_test_fixtures():
|
|
| 212 |
# candidates = [env_path] if env_path else ["Test_Syn_Gen_Know.jsonl"]
|
| 213 |
# candidates = [env_path] if env_path else ["Test_Syn_Sum.jsonl"]
|
| 214 |
# candidates = [env_path] if env_path else ["small_test_cases_v10.jsonl"]
|
| 215 |
-
candidates = [env_path] if env_path else ["Test_Syn_Caregiving_Patient.jsonl"]
|
| 216 |
|
| 217 |
path = next((p for p in candidates if p and os.path.exists(p)), None)
|
| 218 |
if not path:
|
| 219 |
print("Warning: No test fixtures file found for evaluation.")
|
| 220 |
return
|
| 221 |
|
| 222 |
-
# Use the corrected v10 file if available
|
| 223 |
-
# if "conversation_test_fixtures_v10.jsonl" in path:
|
| 224 |
|
| 225 |
# if "Test_Syn_Caregiving_Patient.jsonl" in path:
|
| 226 |
# if "Test_Syn_Caregiving_Caregiver.jsonl" in path:
|
|
@@ -230,7 +227,8 @@ def load_test_fixtures():
|
|
| 230 |
# if "Test_Syn_Gen_Know.jsonl" in path:
|
| 231 |
# if "Test_Syn_Sum.jsonl" in path:
|
| 232 |
# if "small_test_cases_v10.jsonl" in path:
|
| 233 |
-
if "
|
|
|
|
| 234 |
print(f"Using corrected test fixtures: {path}")
|
| 235 |
|
| 236 |
with open(path, "r", encoding="utf-8") as f:
|
|
|
|
| 9 |
from pathlib import Path
|
| 10 |
|
| 11 |
# --- ADD THIS FLAG ---
|
| 12 |
+
# NLU_ONLY_TEST = True
|
| 13 |
+
NLU_ONLY_TEST = False
|
| 14 |
# ---------------------
|
| 15 |
|
| 16 |
# --- Imports from the main application ---
|
|
|
|
| 195 |
# The old code used a relative path, which is unreliable.
|
| 196 |
# This new code builds an absolute path to the fixture file based on
|
| 197 |
# the location of this (evaluate.py) script.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
# default_fixture_file = script_dir / "Test_Syn_Caregiving_Patient.jsonl"
|
| 199 |
# candidates = [env_path] if env_path else [str(default_fixture_file)]
|
| 200 |
+
script_dir = Path(__file__).parent
|
| 201 |
+
default_fixture_file = script_dir / "Test_Data" / "small_test_cases_v10.jsonl"
|
| 202 |
+
candidates = [env_path] if env_path else [str(default_fixture_file)]
|
| 203 |
|
| 204 |
# --- END: DEFINITIVE FIX ---
|
| 205 |
# candidates = [env_path] if env_path else ["conversation_test_fixtures_v10.jsonl"]
|
|
|
|
| 211 |
# candidates = [env_path] if env_path else ["Test_Syn_Gen_Know.jsonl"]
|
| 212 |
# candidates = [env_path] if env_path else ["Test_Syn_Sum.jsonl"]
|
| 213 |
# candidates = [env_path] if env_path else ["small_test_cases_v10.jsonl"]
|
| 214 |
+
# candidates = [env_path] if env_path else ["Test_Syn_Caregiving_Patient.jsonl"]
|
| 215 |
|
| 216 |
path = next((p for p in candidates if p and os.path.exists(p)), None)
|
| 217 |
if not path:
|
| 218 |
print("Warning: No test fixtures file found for evaluation.")
|
| 219 |
return
|
| 220 |
|
|
|
|
|
|
|
| 221 |
|
| 222 |
# if "Test_Syn_Caregiving_Patient.jsonl" in path:
|
| 223 |
# if "Test_Syn_Caregiving_Caregiver.jsonl" in path:
|
|
|
|
| 227 |
# if "Test_Syn_Gen_Know.jsonl" in path:
|
| 228 |
# if "Test_Syn_Sum.jsonl" in path:
|
| 229 |
# if "small_test_cases_v10.jsonl" in path:
|
| 230 |
+
# if "conversation_test_fixtures_v10.jsonl" in path:
|
| 231 |
+
if "small_test_cases_v10.jsonl" in path:
|
| 232 |
print(f"Using corrected test fixtures: {path}")
|
| 233 |
|
| 234 |
with open(path, "r", encoding="utf-8") as f:
|